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.

testMatchCollectionReturnsWhenFound()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 22
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 13
nc 1
nop 0
dl 0
loc 22
rs 9.8333
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Tests\Lib\Routing;
6
7
use Lib\Routing\RouteLoader;
8
use Lib\Routing\UrlMatcher;
9
use Tests\TestCase;
10
11
class UrlMatcherTest extends TestCase
12
{
13
    private $matcher;
14
15
    public function setUp()
16
    {
17
        $loader = new RouteLoader('tests/fixtures/routing.yml');
18
        $collection = $loader->loadRoutes();
19
        $this->matcher = new UrlMatcher($collection);
20
    }
21
22
    public function testMatchReturnsCorrectRoute()
23
    {
24
        $returnBlog = $this->matcher->match('/blog');
25
        $returnSlug = $this->matcher->match('/blog/this-is-a-post');
26
27
        $this->assertEquals(
28
            [
29
                'controller' => 'Blog',
30
                'action' => 'index',
31
                'params' => [],
32
            ],
33
            $returnBlog
34
        );
35
        $this->assertEquals(
36
            [
37
                'controller' => 'Blog',
38
                'action' => 'getPost',
39
                'params' => [
40
                    'slug' => 'this-is-a-post',
41
                ],
42
            ],
43
            $returnSlug
44
        );
45
    }
46
47
    public function testMatchReturnsDefaultNotFound()
48
    {
49
        $return = $this->matcher->match('/blogo');
50
51
        $this->assertEquals(
52
            [
53
                'controller' => 'DefaultController',
54
                'action' => 'notFoundAction',
55
                'params' => [],
56
            ],
57
            $return
58
        );
59
    }
60
61
    public function testMatchCollectionReturnsWhenFound()
62
    {
63
        $returnBlog = $this->matcher->matchCollection('/blog');
64
        $returnSlug = $this->matcher->matchCollection('/blog/this-is-a-post');
65
66
        $this->assertEquals(
67
            [
68
                'controller' => 'Blog',
69
                'action' => 'index',
70
                'params' => [],
71
            ],
72
            $returnBlog
73
        );
74
        $this->assertEquals(
75
            [
76
                'controller' => 'Blog',
77
                'action' => 'getPost',
78
                'params' => [
79
                    'slug' => 'this-is-a-post',
80
                ],
81
            ],
82
            $returnSlug
83
        );
84
    }
85
86
    public function testMatchCollectionDoesNotReturnIfNoMatch()
87
    {
88
        $return = $this->matcher->matchCollection('/blogo');
89
90
        $this->assertNull($return);
91
    }
92
}
93