GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

AbstractHttpProviderTest::testHttpClientGetter()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
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\Http\Provider\Tests;
14
15
use Geocoder\Collection;
16
use Geocoder\Http\Provider\AbstractHttpProvider;
17
use Geocoder\Model\AddressCollection;
18
use Geocoder\Query\GeocodeQuery;
19
use Geocoder\Query\ReverseQuery;
20
use Http\Client\HttpClient;
21
use Http\Discovery\ClassDiscovery;
22
use Http\Mock\Client;
23
use PHPUnit\Framework\TestCase;
24
25
class AbstractHttpProviderTest extends TestCase
26
{
27
    public static function setUpBeforeClass()
28
    {
29
        ClassDiscovery::prependStrategy('\Nyholm\Psr7\Httplug\DiscoveryStrategy');
30
    }
31
32
    public function testHttpClientGetter()
33
    {
34
        $client = $this->getMockBuilder(Client::class)->disableOriginalConstructor()->getMock();
35
        $provider = new DummyProvider($client);
36
        $this->assertSame($client, $provider->getHttpClient());
37
    }
38
}
39
40
class DummyProvider extends AbstractHttpProvider
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class should be in its own file to aid autoloaders.

Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.

Loading history...
41
{
42
    public function getHttpClient(): HttpClient
43
    {
44
        return parent::getHttpClient();
45
    }
46
47
    public function geocodeQuery(GeocodeQuery $query): Collection
48
    {
49
        return new AddressCollection([]);
50
    }
51
52
    public function reverseQuery(ReverseQuery $query): Collection
53
    {
54
        return new AddressCollection([]);
55
    }
56
57
    public function getName(): string
58
    {
59
        return 'dummy';
60
    }
61
}
62