@@ -339,22 +339,22 @@ public function testGenerate()
339339 {
340340 $ route = $ this ->getDm ()->find (null , self ::ROUTE_ROOT .'/testroute/child ' );
341341
342- $ url = $ this ->router ->generate ($ route , ['test ' => 'value ' ]);
342+ $ url = $ this ->router ->generate (RouteObjectInterface:: OBJECT_BASED_ROUTE_NAME , ['test ' => 'value ' , RouteObjectInterface:: ROUTE_OBJECT => $ route ]);
343343 $ this ->assertEquals ('/testroute/child?test=value ' , $ url );
344344 }
345345
346346 public function testGenerateAbsolute ()
347347 {
348348 $ route = $ this ->getDm ()->find (null , self ::ROUTE_ROOT .'/testroute/child ' );
349- $ url = $ this ->router ->generate ($ route , ['test ' => 'value ' ], UrlGeneratorInterface::ABSOLUTE_URL );
349+ $ url = $ this ->router ->generate (RouteObjectInterface:: OBJECT_BASED_ROUTE_NAME , ['test ' => 'value ' , RouteObjectInterface:: ROUTE_OBJECT => $ route ], UrlGeneratorInterface::ABSOLUTE_URL );
350350 $ this ->assertEquals ('http://localhost/testroute/child?test=value ' , $ url );
351351 }
352352
353353 public function testGenerateParameters ()
354354 {
355355 $ route = $ this ->getDm ()->find (null , self ::ROUTE_ROOT .'/testroute ' );
356356
357- $ url = $ this ->router ->generate ($ route , ['slug ' => 'gen-slug ' , 'test ' => 'value ' ]);
357+ $ url = $ this ->router ->generate (RouteObjectInterface:: OBJECT_BASED_ROUTE_NAME , ['slug ' => 'gen-slug ' , 'test ' => 'value ' , RouteObjectInterface:: ROUTE_OBJECT => $ route ]);
358358 $ this ->assertEquals ('/testroute/gen-slug?test=value ' , $ url );
359359 }
360360
@@ -363,22 +363,22 @@ public function testGenerateParametersInvalid()
363363 $ route = $ this ->getDm ()->find (null , self ::ROUTE_ROOT .'/testroute ' );
364364
365365 $ this ->expectException (InvalidParameterException::class);
366- $ this ->router ->generate ($ route , ['slug ' => 'gen-slug ' , 'id ' => 'nonumber ' ]);
366+ $ this ->router ->generate (RouteObjectInterface:: OBJECT_BASED_ROUTE_NAME , ['slug ' => 'gen-slug ' , 'id ' => 'nonumber ' , RouteObjectInterface:: ROUTE_OBJECT => $ route ]);
367367 }
368368
369369 public function testGenerateDefaultFormat ()
370370 {
371371 $ route = $ this ->getDm ()->find (null , self ::ROUTE_ROOT .'/format ' );
372372
373- $ url = $ this ->router ->generate ($ route , ['id ' => 37 ]);
373+ $ url = $ this ->router ->generate (RouteObjectInterface:: OBJECT_BASED_ROUTE_NAME , ['id ' => 37 , RouteObjectInterface:: ROUTE_OBJECT => $ route ]);
374374 $ this ->assertEquals ('/format/37 ' , $ url );
375375 }
376376
377377 public function testGenerateFormat ()
378378 {
379379 $ route = $ this ->getDm ()->find (null , self ::ROUTE_ROOT .'/format ' );
380380
381- $ url = $ this ->router ->generate ($ route , ['id ' => 37 , '_format ' => 'json ' ]);
381+ $ url = $ this ->router ->generate (RouteObjectInterface:: OBJECT_BASED_ROUTE_NAME , ['id ' => 37 , '_format ' => 'json ' , RouteObjectInterface:: ROUTE_OBJECT => $ route ]);
382382 $ this ->assertEquals ('/format/37.json ' , $ url );
383383 }
384384
@@ -387,6 +387,6 @@ public function testGenerateNoMatchingFormat()
387387 $ route = $ this ->getDm ()->find (null , self ::ROUTE_ROOT .'/format ' );
388388
389389 $ this ->expectException (InvalidParameterException::class);
390- $ this ->router ->generate ($ route , ['id ' => 37 , '_format ' => 'xyz ' ]);
390+ $ this ->router ->generate (RouteObjectInterface:: OBJECT_BASED_ROUTE_NAME , ['id ' => 37 , '_format ' => 'xyz ' , RouteObjectInterface:: ROUTE_OBJECT => $ route ]);
391391 }
392392}
0 commit comments