Test Setup Failed
Branch master (97a7ce)
by Anton
02:01
created

IpLocatorTest   A

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 Anax\DI\DIFactoryConfig;
0 ignored issues
show
Bug introduced by
The type Anax\DI\DIFactoryConfig was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

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