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.
Completed
Push — master ( dd680f...a61514 )
by Christian
01:32
created

CountryServiceTest::testSearch()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 23

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 9.552
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * (c) Christian Gripp <[email protected]>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Core23\SetlistFm\Tests\Service;
11
12
use Core23\SetlistFm\Connection\ConnectionInterface;
13
use Core23\SetlistFm\Service\CountryService;
14
use PHPUnit\Framework\TestCase;
15
16
class CountryServiceTest extends TestCase
17
{
18
    private $connection;
19
20
    protected function setUp()
21
    {
22
        $this->connection =  $this->prophesize(ConnectionInterface::class);
23
    }
24
25
    public function testItIsInstantiable(): void
26
    {
27
        $service = new CountryService($this->connection->reveal());
28
29
        $this->assertNotNull($service);
30
    }
31
32
    public function testSearch(): void
33
    {
34
        $rawResponse = <<<'EOD'
35
                    {
36
                      "country" : [ {
37
                        "code" : "US",
38
                        "name" : "United States"
39
                      }],
40
                      "total" : 1,
41
                      "page" : 1,
42
                      "itemsPerPage" : 20
43
                    }
44
EOD;
45
46
        $this->connection->call('search/countries')
47
            ->willReturn(json_decode($rawResponse, true))
48
        ;
49
50
        $service = new CountryService($this->connection->reveal());
51
        $result  = $service->search();
52
53
        $this->assertCount(1, $result);
54
    }
55
}
56