IntegrationTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 24
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A createProvider() 0 3 1
A getApiKey() 0 3 1
A getCacheDir() 0 3 1
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\GraphHopper\Tests;
14
15
use Geocoder\IntegrationTest\ProviderIntegrationTest;
16
use Geocoder\Provider\GraphHopper\GraphHopper;
17
use Http\Client\HttpClient;
18
19
/**
20
 * @author Tobias Nyholm <[email protected]>
21
 */
22
class IntegrationTest extends ProviderIntegrationTest
23
{
24
    protected $skippedTests = [
25
        'testGeocodeQuery' => 'We get "Great George Street" as first result.',
26
        'testReverseQueryWithNoResults' => 'We get "Atlas Buoy 0.00E 0.00N" monitoring station.',
27
    ];
28
29
    protected $testIpv4 = false;
30
31
    protected $testIpv6 = false;
32
33
    protected function createProvider(HttpClient $httpClient)
34
    {
35
        return new GraphHopper($httpClient, $this->getApiKey());
36
    }
37
38
    protected function getCacheDir()
39
    {
40
        return __DIR__.'/.cached_responses';
41
    }
42
43
    protected function getApiKey()
44
    {
45
        return $_SERVER['GRAPHHOPPER_API_KEY'];
46
    }
47
}
48