IpLocatorTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testGetGeoInfo() 0 17 1
1
<?php
2
3
namespace EVB\Weather;
4
5
use PHPUnit\Framework\TestCase;
6
7
/**
8
 * Test IpLocator for Weather.
9
 */
10
class IpLocatorTest extends TestCase
11
{
12
    /**
13
     * Test getGeoInfo() method.
14
     * Gets info.
15
     */
16
    public function testGetGeoInfo()
17
    {
18
        $data = [
19
            "continent_name" => "test",
20
            "country_name" => "test",
21
            "region_name" => "test",
22
            "city" => "test",
23
            "zip" => "test"
24
        ];
25
26
        $curl = new \EVB\Weather\MockCurlWrapper(\json_encode($data));
27
28
        $sut = new IpLocator("test", $curl);
29
30
        $result = $sut->getGeoInfo("test");
31
32
        $this->assertEquals($data, $result);
33
    }
34
}
35