Conditions | 1 |
Paths | 1 |
Total Lines | 42 |
Code Lines | 27 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
31 | public function testFoo() |
||
32 | { |
||
33 | $this->mapper = $this |
||
34 | ->getMockBuilder('Mado\QueryBundle\Component\Meta\DataMapper') |
||
35 | ->disableOriginalConstructor() |
||
36 | ->getMock(); |
||
37 | $this->mapper->expects($this->once()) |
||
38 | ->method('getMap') |
||
39 | ->will($this->returnValue([ |
||
40 | 'start' => [ |
||
41 | 'relations' => [ |
||
42 | 'fine' => 'end', |
||
43 | ] |
||
44 | ], |
||
45 | 'end' => [ |
||
46 | 'relations' => [ |
||
47 | 'inizio' => 'start', |
||
48 | ] |
||
49 | ] |
||
50 | ])); |
||
51 | |||
52 | $this->dijkstra = $this |
||
53 | ->getMockBuilder('Mado\QueryBundle\Component\Meta\Dijkstra') |
||
54 | ->disableOriginalConstructor() |
||
55 | ->getMock(); |
||
56 | $this->dijkstra->expects($this->once()) |
||
57 | ->method('shortestPaths') |
||
58 | ->will($this->returnValue([[ |
||
59 | 'start', |
||
60 | 'end' |
||
61 | ]])); |
||
62 | |||
63 | $this->walker = new DijkstraWalker( |
||
64 | $this->mapper, |
||
65 | $this->dijkstra |
||
66 | ); |
||
67 | |||
68 | // complete test with map |
||
69 | |||
70 | $this->walker->buildPathBetween('start', 'end'); |
||
71 | |||
72 | $this->walker->getPath(); |
||
73 | } |
||
75 |