@@ -29,6 +29,7 @@ public function setUp()
29
29
$ this ->baseNode = new \stdClass ;
30
30
$ this ->parentRoute = new \stdClass ;
31
31
$ this ->route = $ this ->prophesize ('Symfony\Cmf\Component\RoutingAuto\Model\AutoRouteInterface ' );
32
+ $ this ->uriContext = $ this ->prophesize ('Symfony\Cmf\Component\RoutingAuto\UriContext ' );
32
33
33
34
$ this ->phpcrSession = $ this ->prophesize ('PHPCR\SessionInterface ' );
34
35
$ this ->phpcrRootNode = $ this ->prophesize ('PHPCR\NodeInterface ' );
@@ -114,7 +115,9 @@ public function testCreateAutoRoute($path, $expectedParentPath, $expectedName, $
114
115
->willReturn (null );
115
116
}
116
117
117
- $ res = $ this ->adapter ->createAutoRoute ($ path , $ this ->contentDocument , 'fr ' );
118
+ $ this ->uriContext ->getUri ()->willReturn ($ path );
119
+
120
+ $ res = $ this ->adapter ->createAutoRoute ($ this ->uriContext ->reveal (), $ this ->contentDocument , 'fr ' );
118
121
$ this ->assertNotNull ($ res );
119
122
$ this ->assertInstanceOf ('Symfony\Cmf\Bundle\RoutingAutoBundle\Model\AutoRoute ' , $ res );
120
123
$ this ->assertEquals ($ expectedName , $ res ->getName ());
@@ -131,7 +134,8 @@ public function testCreateAutoRouteNonExistingBasePath()
131
134
{
132
135
$ this ->dm ->getPhpcrSession ()->willReturn ($ this ->phpcrSession );
133
136
$ this ->dm ->find (null , $ this ->baseRoutePath )->willReturn (null );
134
- $ this ->adapter ->createAutoRoute ('/foo ' , $ this ->contentDocument , 'fr ' );
137
+ $ this ->uriContext ->getUri ()->willReturn ('/asdasd ' );
138
+ $ this ->adapter ->createAutoRoute ($ this ->uriContext ->reveal (), $ this ->contentDocument , 'fr ' );
135
139
}
136
140
137
141
@@ -176,7 +180,7 @@ public function testFindRouteForUri()
176
180
177
181
$ this ->dm ->find (null , $ this ->baseRoutePath . $ uri )->willReturn ($ expectedRoutes );
178
182
179
- $ res = $ this ->adapter ->findRouteForUri ($ uri );
183
+ $ res = $ this ->adapter ->findRouteForUri ($ uri, $ this -> uriContext -> reveal () );
180
184
$ this ->assertSame ($ expectedRoutes , $ res );
181
185
}
182
186
}
0 commit comments