@@ -339,22 +339,22 @@ public function testGenerate()
339
339
{
340
340
$ route = $ this ->getDm ()->find (null , self ::ROUTE_ROOT .'/testroute/child ' );
341
341
342
- $ url = $ this ->router ->generate ($ route , ['test ' => 'value ' ]);
342
+ $ url = $ this ->router ->generate (RouteObjectInterface:: OBJECT_BASED_ROUTE_NAME , ['test ' => 'value ' , RouteObjectInterface:: ROUTE_OBJECT => $ route ]);
343
343
$ this ->assertEquals ('/testroute/child?test=value ' , $ url );
344
344
}
345
345
346
346
public function testGenerateAbsolute ()
347
347
{
348
348
$ 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 );
350
350
$ this ->assertEquals ('http://localhost/testroute/child?test=value ' , $ url );
351
351
}
352
352
353
353
public function testGenerateParameters ()
354
354
{
355
355
$ route = $ this ->getDm ()->find (null , self ::ROUTE_ROOT .'/testroute ' );
356
356
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 ]);
358
358
$ this ->assertEquals ('/testroute/gen-slug?test=value ' , $ url );
359
359
}
360
360
@@ -363,22 +363,22 @@ public function testGenerateParametersInvalid()
363
363
$ route = $ this ->getDm ()->find (null , self ::ROUTE_ROOT .'/testroute ' );
364
364
365
365
$ 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 ]);
367
367
}
368
368
369
369
public function testGenerateDefaultFormat ()
370
370
{
371
371
$ route = $ this ->getDm ()->find (null , self ::ROUTE_ROOT .'/format ' );
372
372
373
- $ url = $ this ->router ->generate ($ route , ['id ' => 37 ]);
373
+ $ url = $ this ->router ->generate (RouteObjectInterface:: OBJECT_BASED_ROUTE_NAME , ['id ' => 37 , RouteObjectInterface:: ROUTE_OBJECT => $ route ]);
374
374
$ this ->assertEquals ('/format/37 ' , $ url );
375
375
}
376
376
377
377
public function testGenerateFormat ()
378
378
{
379
379
$ route = $ this ->getDm ()->find (null , self ::ROUTE_ROOT .'/format ' );
380
380
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 ]);
382
382
$ this ->assertEquals ('/format/37.json ' , $ url );
383
383
}
384
384
@@ -387,6 +387,6 @@ public function testGenerateNoMatchingFormat()
387
387
$ route = $ this ->getDm ()->find (null , self ::ROUTE_ROOT .'/format ' );
388
388
389
389
$ 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 ]);
391
391
}
392
392
}
0 commit comments