Completed
Push — master ( 8a76c4...37105e )
by Tobias
05:51
created

IntegrationTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 2
dl 0
loc 24
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of the Geocoder package.
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @license    MIT License
9
 */
10
11
namespace Geocoder\Provider\MaxMind\Tests;
12
13
use Geocoder\IntegrationTest\ProviderIntegrationTest;
14
use Geocoder\Provider\MaxMind\MaxMind;
15
use Http\Client\HttpClient;
16
17
/**
18
 * @author Tobias Nyholm <[email protected]>
19
 */
20
class IntegrationTest extends ProviderIntegrationTest
21
{
22
    protected $testAddress = false;
23
    protected $testReverse = false;
24
25
    protected function createProvider(HttpClient $httpClient)
26
    {
27
        return new MaxMind($httpClient, $this->getApiKey());
28
    }
29
30
    protected function getCacheDir()
31
    {
32
        return __DIR__.'/.cached_responses';
33
    }
34
35
    protected function getApiKey()
36
    {
37
        if (!isset($_SERVER['MAXMIND_API_KEY'])) {
38
            $this->markTestSkipped('No MaxMind API key');
39
        }
40
41
        return $_SERVER['MAXMIND_API_KEY'];
42
    }
43
}
44