ShopUserInfoTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
c 0
b 0
f 0
dl 0
loc 17
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testSetLocation() 0 15 1
1
<?php
2
3
namespace SilverShop\Tests;
4
5
use SilverShop\ShopUserInfo;
6
use SilverStripe\Dev\SapphireTest;
7
8
class ShopUserInfoTest extends SapphireTest
9
{
10
    public function testSetLocation()
11
    {
12
        ShopUserInfo::singleton()->setLocation(
13
            [
14
                'Country' => 'NZ',
15
                'State' => 'Wellington',
16
                'City' => 'Newton',
17
            ]
18
        );
19
20
        $location = ShopUserInfo::singleton()->getAddress();
21
22
        $this->assertEquals($location->Country, 'NZ');
23
        $this->assertEquals($location->State, 'Wellington');
24
        $this->assertEquals($location->City, 'Newton');
25
    }
26
}
27