ZonedShippingMethodTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 26
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testDefaultRate() 0 14 1
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
}