Conditions | 1 |
Paths | 1 |
Total Lines | 14 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
13 | public function testDefaultRate() { |
||
14 | $type = "address"; |
||
15 | $address = $this->internationaladdress; |
||
|
|||
16 | $defaultrate = new ZonedShippingRate(array( |
||
17 | "Rate" => 100, |
||
18 | "ZoneID" => $this->objFromFixture("Zone", "int")->ID |
||
19 | )); |
||
20 | $defaultrate->write(); |
||
21 | $this->addressshipping->Rates()->add($defaultrate); |
||
22 | |||
23 | $this->assertMatch($type, $this->p0, $address, 100); |
||
24 | $this->assertMatch($type, $this->p2, $address, 100); |
||
25 | $this->assertMatch($type, $this->p4, $address, 100); |
||
26 | } |
||
27 | |||
28 | } |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: