Total Complexity | 3 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
12 | class EmptyIpLocationResolverTest extends TestCase |
||
13 | { |
||
14 | use StringUtilsTrait; |
||
15 | |||
16 | private const EMPTY_RESP = [ |
||
17 | 'country_code' => '', |
||
18 | 'country_name' => '', |
||
19 | 'region_name' => '', |
||
20 | 'city' => '', |
||
21 | 'latitude' => '', |
||
22 | 'longitude' => '', |
||
23 | 'time_zone' => '', |
||
24 | ]; |
||
25 | |||
26 | /** |
||
27 | * @var EmptyIpLocationResolver |
||
28 | */ |
||
29 | private $resolver; |
||
30 | |||
31 | public function setUp() |
||
32 | { |
||
33 | $this->resolver = new EmptyIpLocationResolver(); |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * @test |
||
38 | * @dataProvider provideEmptyResponses |
||
39 | */ |
||
40 | public function alwaysReturnsAnEmptyResponse(array $expected, string $ipAddress) |
||
41 | { |
||
42 | $this->assertEquals($expected, $this->resolver->resolveIpLocation($ipAddress)); |
||
43 | } |
||
44 | |||
45 | public function provideEmptyResponses(): array |
||
49 | }); |
||
50 | } |
||
51 | } |
||
52 |