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.
Passed
Pull Request — master (#62)
by Simone
02:32
created

testThrownAnExceptionWheneverPathIsRequestedBeforeBuild()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 12
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 18
rs 9.4285
1
<?php
2
3
use Mado\QueryBundle\Component\Meta\DijkstraWalker;
4
use PHPUnit\Framework\TestCase as TestCase;
5
6
class DijkstraWalkerTest extends TestCase
7
{
8
    /**
9
     * @expectedException \RuntimeException
10
     */
11
    public function testThrownAnExceptionWheneverPathIsRequestedBeforeBuild()
12
    {
13
        $this->mapper = $this
0 ignored issues
show
Bug Best Practice introduced by
The property mapper does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
14
            ->getMockBuilder('Mado\QueryBundle\Component\Meta\DataMapper')
15
            ->disableOriginalConstructor()
16
            ->getMock();
17
18
        $this->dijkstra = $this
0 ignored issues
show
Bug Best Practice introduced by
The property dijkstra does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
19
            ->getMockBuilder('Mado\QueryBundle\Component\Meta\Dijkstra')
20
            ->disableOriginalConstructor()
21
            ->getMock();
22
23
        $this->walker = new DijkstraWalker(
0 ignored issues
show
Bug Best Practice introduced by
The property walker does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
24
            $this->mapper,
25
            $this->dijkstra
26
        );
27
28
        $this->walker->getPath();
29
    }
30
31
    public function testBuildPathUsingDijkstra()
32
    {
33
        $this->mapper = $this
0 ignored issues
show
Bug Best Practice introduced by
The property mapper does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
34
            ->getMockBuilder('Mado\QueryBundle\Component\Meta\DataMapper')
35
            ->disableOriginalConstructor()
36
            ->getMock();
37
        $this->mapper->expects($this->once())
38
            ->method('getMap')
39
            ->will($this->returnValue($laMappa = [
40
                'start' => [
41
                    'relations' => [
42
                        'fine' => 'end',
43
                    ]
44
                ],
45
                'end' => [
46
                    'relations' => [
47
                        'inizio' => 'start',
48
                    ]
49
                ]
50
            ]));
51
52
        $this->dijkstra = $this
0 ignored issues
show
Bug Best Practice introduced by
The property dijkstra does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
53
            ->getMockBuilder('Mado\QueryBundle\Component\Meta\Dijkstra')
54
            ->disableOriginalConstructor()
55
            ->getMock();
56
        $this->dijkstra->expects($this->once())
57
            ->method('setMap')
58
            ->with($laMappa);
59
        $this->dijkstra->expects($this->once())
60
            ->method('shortestPaths')
61
            ->will($this->returnValue([[
62
                'start',
63
                'end'
64
            ]]));
65
66
        $this->walker = new DijkstraWalker(
0 ignored issues
show
Bug Best Practice introduced by
The property walker does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
67
            $this->mapper,
68
            $this->dijkstra
69
        );
70
71
        $this->walker->buildPathBetween('start', 'end');
72
73
        $pathFound = $this->walker->getPath();
74
75
        $this->assertEquals(
76
            '_embedded.fine',
77
            $pathFound
78
        );
79
    }
80
}
81