ZonedShippingMethodTest::testDefaultRate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 11
nc 1
nop 0
1
<?php
2
3
class ZonedShippingMethodTest extends TableShippingMethodTest{
4
    
5
    static $fixture_file = array(
6
        'silvershop-shipping/tests/fixtures/ZonedShippingMethod.yml'
7
    );
8
9
    protected $fixtureclass = "ZonedShippingMethod";
10
11
    //This test suite shares tests with TableShippingMethod
12
13
    public function testDefaultRate() {
14
        $type = "address";
15
        $address = $this->internationaladdress;
0 ignored issues
show
Bug introduced by
The property internationaladdress does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
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);
0 ignored issues
show
Bug introduced by
The property addressshipping does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
22
        
23
        $this->assertMatch($type, $this->p0, $address, 100);
0 ignored issues
show
Bug introduced by
The property p0 does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
24
        $this->assertMatch($type, $this->p2, $address, 100);
0 ignored issues
show
Bug introduced by
The property p2 does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
25
        $this->assertMatch($type, $this->p4, $address, 100);
0 ignored issues
show
Bug introduced by
The property p4 does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
26
    }
27
    
28
}