@@ -29,6 +29,7 @@ public function setUp()
2929 $ this ->baseNode = new \stdClass ;
3030 $ this ->parentRoute = new \stdClass ;
3131 $ this ->route = $ this ->prophesize ('Symfony\Cmf\Component\RoutingAuto\Model\AutoRouteInterface ' );
32+ $ this ->uriContext = $ this ->prophesize ('Symfony\Cmf\Component\RoutingAuto\UriContext ' );
3233
3334 $ this ->phpcrSession = $ this ->prophesize ('PHPCR\SessionInterface ' );
3435 $ this ->phpcrRootNode = $ this ->prophesize ('PHPCR\NodeInterface ' );
@@ -114,7 +115,9 @@ public function testCreateAutoRoute($path, $expectedParentPath, $expectedName, $
114115 ->willReturn (null );
115116 }
116117
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 ' );
118121 $ this ->assertNotNull ($ res );
119122 $ this ->assertInstanceOf ('Symfony\Cmf\Bundle\RoutingAutoBundle\Model\AutoRoute ' , $ res );
120123 $ this ->assertEquals ($ expectedName , $ res ->getName ());
@@ -131,7 +134,8 @@ public function testCreateAutoRouteNonExistingBasePath()
131134 {
132135 $ this ->dm ->getPhpcrSession ()->willReturn ($ this ->phpcrSession );
133136 $ 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 ' );
135139 }
136140
137141
@@ -176,7 +180,7 @@ public function testFindRouteForUri()
176180
177181 $ this ->dm ->find (null , $ this ->baseRoutePath . $ uri )->willReturn ($ expectedRoutes );
178182
179- $ res = $ this ->adapter ->findRouteForUri ($ uri );
183+ $ res = $ this ->adapter ->findRouteForUri ($ uri, $ this -> uriContext -> reveal () );
180184 $ this ->assertSame ($ expectedRoutes , $ res );
181185 }
182186}
0 commit comments