Completed
Push — master ( a85d22...dabb22 )
by Tobias
06:15
created

IntegrationTest::setUpBeforeClass()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 12
Code Lines 6

Duplication

Lines 12
Ratio 100 %

Importance

Changes 0
Metric Value
dl 12
loc 12
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 6
nc 4
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Geocoder package.
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @license    MIT License
11
 */
12
13
namespace Geocoder\Provider\MaxMindBinary\Tests;
14
15
use Geocoder\IntegrationTest\ProviderIntegrationTest;
16
use Geocoder\Provider\MaxMindBinary\MaxMindBinary;
17
use Http\Client\HttpClient;
18
19
/**
20
 * @author Tobias Nyholm <[email protected]>
21
 */
22
class IntegrationTest extends ProviderIntegrationTest
23
{
24
    protected $skippedTests = [
25
    ];
26
27
    protected $testAddress = false;
28
    protected $testReverse = false;
29
    protected $testIpv6 = false;
30
    protected $testHttpProvider = false;
31
32
    public static function setUpBeforeClass()
33
    {
34
        if (false == function_exists('geoip_open')) {
35
            self::markTestSkipped('The maxmind\'s official lib required to run these tests.');
36
        }
37
38
        if (false == function_exists('GeoIP_record_by_addr')) {
39
            self::markTestSkipped('The maxmind\'s official lib required to run these tests.');
40
        }
41
42
        parent::setUpBeforeClass();
43
    }
44
45
    protected function createProvider(HttpClient $httpClient)
46
    {
47
        return new MaxMindBinary(__DIR__.'/fixtures/GeoLiteCity.dat');
48
    }
49
50
    protected function getCacheDir()
51
    {
52
        return __DIR__.'/.cached_responses';
53
    }
54
55
    protected function getApiKey()
56
    {
57
        return null;
58
    }
59
}
60