IpLocatorTest::testGetGeoInfo()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 10
nc 1
nop 0
dl 0
loc 17
rs 9.9332
c 0
b 0
f 0
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