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.

UrlGeneratorRegistryTest::mockUrlGenerator()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Hateoas\Tests\UrlGenerator;
4
5
use Hateoas\Tests\TestCase;
6
use Hateoas\UrlGenerator\UrlGeneratorRegistry;
7
8
class UrlGeneratorRegistryTest extends TestCase
9
{
10
    public function test()
11
    {
12
        $defaultUrlGenerator = $this->mockUrlGenerator();
13
        $registry = new UrlGeneratorRegistry($defaultUrlGenerator);
14
15
        $this->assertSame($defaultUrlGenerator, $registry->get(UrlGeneratorRegistry::DEFAULT_URL_GENERATOR_KEY));
16
        $this->assertSame($defaultUrlGenerator, $registry->get());
17
18
        $exception = null;
19
        try {
20
            $registry->get('foo');
21
        } catch (\Exception $e) {
22
            $exception = $e;
23
        }
24
        $this->assertInstanceOf('InvalidArgumentException', $exception);
25
        $this->assertSame(
26
            'The "foo" url generator is not set. Available url generators are: default.',
27
            $exception->getMessage()
28
        );
29
30
        $registry->set('foo', $fooUrlGenerator = $this->mockUrlGenerator());
31
        $this->assertSame($fooUrlGenerator, $registry->get('foo'));
32
    }
33
34
    private function mockUrlGenerator()
35
    {
36
        return $this->prophesize('Hateoas\UrlGenerator\UrlGeneratorInterface')->reveal();
37
    }
38
}
39