@@ -79,11 +79,9 @@ public function testRelativeUrlWithNullParameter()
7979 $ this ->assertEquals ('/app.php/testing ' , $ url );
8080 }
8181
82- /**
83- * @expectedException \Symfony\Component\Routing\Exception\InvalidParameterException
84- */
8582 public function testRelativeUrlWithNullParameterButNotOptional ()
8683 {
84+ $ this ->expectException ('Symfony\Component\Routing\Exception\InvalidParameterException ' );
8785 $ routes = $ this ->getRoutes ('test ' , new Route ('/testing/{foo}/bar ' , ['foo ' => null ]));
8886 // This must raise an exception because the default requirement for "foo" is "[^/]+" which is not met with these params.
8987 // Generating path "/testing//bar" would be wrong as matching this route would fail.
@@ -241,20 +239,16 @@ public function testGenerateWithOverriddenParameterLocaleFromRequestContext()
241239 );
242240 }
243241
244- /**
245- * @expectedException \Symfony\Component\Routing\Exception\RouteNotFoundException
246- */
247242 public function testGenerateWithoutRoutes ()
248243 {
244+ $ this ->expectException ('Symfony\Component\Routing\Exception\RouteNotFoundException ' );
249245 $ routes = $ this ->getRoutes ('foo ' , new Route ('/testing/{foo} ' ));
250246 $ this ->getGenerator ($ routes )->generate ('test ' , [], UrlGeneratorInterface::ABSOLUTE_URL );
251247 }
252248
253- /**
254- * @expectedException \Symfony\Component\Routing\Exception\RouteNotFoundException
255- */
256249 public function testGenerateWithInvalidLocale ()
257250 {
251+ $ this ->expectException ('Symfony\Component\Routing\Exception\RouteNotFoundException ' );
258252 $ routes = new RouteCollection ();
259253
260254 $ route = new Route ('' );
@@ -273,29 +267,23 @@ public function testGenerateWithInvalidLocale()
273267 $ generator ->generate ($ name );
274268 }
275269
276- /**
277- * @expectedException \Symfony\Component\Routing\Exception\MissingMandatoryParametersException
278- */
279270 public function testGenerateForRouteWithoutMandatoryParameter ()
280271 {
272+ $ this ->expectException ('Symfony\Component\Routing\Exception\MissingMandatoryParametersException ' );
281273 $ routes = $ this ->getRoutes ('test ' , new Route ('/testing/{foo} ' ));
282274 $ this ->getGenerator ($ routes )->generate ('test ' , [], UrlGeneratorInterface::ABSOLUTE_URL );
283275 }
284276
285- /**
286- * @expectedException \Symfony\Component\Routing\Exception\InvalidParameterException
287- */
288277 public function testGenerateForRouteWithInvalidOptionalParameter ()
289278 {
279+ $ this ->expectException ('Symfony\Component\Routing\Exception\InvalidParameterException ' );
290280 $ routes = $ this ->getRoutes ('test ' , new Route ('/testing/{foo} ' , ['foo ' => '1 ' ], ['foo ' => 'd+ ' ]));
291281 $ this ->getGenerator ($ routes )->generate ('test ' , ['foo ' => 'bar ' ], UrlGeneratorInterface::ABSOLUTE_URL );
292282 }
293283
294- /**
295- * @expectedException \Symfony\Component\Routing\Exception\InvalidParameterException
296- */
297284 public function testGenerateForRouteWithInvalidParameter ()
298285 {
286+ $ this ->expectException ('Symfony\Component\Routing\Exception\InvalidParameterException ' );
299287 $ routes = $ this ->getRoutes ('test ' , new Route ('/testing/{foo} ' , [], ['foo ' => '1|2 ' ]));
300288 $ this ->getGenerator ($ routes )->generate ('test ' , ['foo ' => '0 ' ], UrlGeneratorInterface::ABSOLUTE_URL );
301289 }
@@ -327,29 +315,23 @@ public function testGenerateForRouteWithInvalidParameterButDisabledRequirementsC
327315 $ this ->assertSame ('/app.php/testing/bar ' , $ generator ->generate ('test ' , ['foo ' => 'bar ' ]));
328316 }
329317
330- /**
331- * @expectedException \Symfony\Component\Routing\Exception\InvalidParameterException
332- */
333318 public function testGenerateForRouteWithInvalidMandatoryParameter ()
334319 {
320+ $ this ->expectException ('Symfony\Component\Routing\Exception\InvalidParameterException ' );
335321 $ routes = $ this ->getRoutes ('test ' , new Route ('/testing/{foo} ' , [], ['foo ' => 'd+ ' ]));
336322 $ this ->getGenerator ($ routes )->generate ('test ' , ['foo ' => 'bar ' ], UrlGeneratorInterface::ABSOLUTE_URL );
337323 }
338324
339- /**
340- * @expectedException \Symfony\Component\Routing\Exception\InvalidParameterException
341- */
342325 public function testGenerateForRouteWithInvalidUtf8Parameter ()
343326 {
327+ $ this ->expectException ('Symfony\Component\Routing\Exception\InvalidParameterException ' );
344328 $ routes = $ this ->getRoutes ('test ' , new Route ('/testing/{foo} ' , [], ['foo ' => '\pL+ ' ], ['utf8 ' => true ]));
345329 $ this ->getGenerator ($ routes )->generate ('test ' , ['foo ' => 'abc123 ' ], UrlGeneratorInterface::ABSOLUTE_URL );
346330 }
347331
348- /**
349- * @expectedException \Symfony\Component\Routing\Exception\InvalidParameterException
350- */
351332 public function testRequiredParamAndEmptyPassed ()
352333 {
334+ $ this ->expectException ('Symfony\Component\Routing\Exception\InvalidParameterException ' );
353335 $ routes = $ this ->getRoutes ('test ' , new Route ('/{slug} ' , [], ['slug ' => '.+ ' ]));
354336 $ this ->getGenerator ($ routes )->generate ('test ' , ['slug ' => '' ]);
355337 }
@@ -509,31 +491,25 @@ public function testImportantVariable()
509491 $ this ->assertSame ('/app.php/index.mobile.html ' , $ generator ->generate ('test ' , ['page ' => 'index ' ]));
510492 }
511493
512- /**
513- * @expectedException \Symfony\Component\Routing\Exception\MissingMandatoryParametersException
514- */
515494 public function testImportantVariableWithNoDefault ()
516495 {
496+ $ this ->expectException ('Symfony\Component\Routing\Exception\MissingMandatoryParametersException ' );
517497 $ routes = $ this ->getRoutes ('test ' , new Route ('/{page}.{!_format} ' ));
518498 $ generator = $ this ->getGenerator ($ routes );
519499
520500 $ generator ->generate ('test ' , ['page ' => 'index ' ]);
521501 }
522502
523- /**
524- * @expectedException \Symfony\Component\Routing\Exception\InvalidParameterException
525- */
526503 public function testDefaultRequirementOfVariableDisallowsSlash ()
527504 {
505+ $ this ->expectException ('Symfony\Component\Routing\Exception\InvalidParameterException ' );
528506 $ routes = $ this ->getRoutes ('test ' , new Route ('/{page}.{_format} ' ));
529507 $ this ->getGenerator ($ routes )->generate ('test ' , ['page ' => 'index ' , '_format ' => 'sl/ash ' ]);
530508 }
531509
532- /**
533- * @expectedException \Symfony\Component\Routing\Exception\InvalidParameterException
534- */
535510 public function testDefaultRequirementOfVariableDisallowsNextSeparator ()
536511 {
512+ $ this ->expectException ('Symfony\Component\Routing\Exception\InvalidParameterException ' );
537513 $ routes = $ this ->getRoutes ('test ' , new Route ('/{page}.{_format} ' ));
538514 $ this ->getGenerator ($ routes )->generate ('test ' , ['page ' => 'do.t ' , '_format ' => 'html ' ]);
539515 }
@@ -559,29 +535,23 @@ public function testWithHostSameAsContextAndAbsolute()
559535 $ this ->assertEquals ('http://fr.example.com/app.php/Fabien ' , $ this ->getGenerator ($ routes , ['host ' => 'fr.example.com ' ])->generate ('test ' , ['name ' => 'Fabien ' , 'locale ' => 'fr ' ], UrlGeneratorInterface::ABSOLUTE_URL ));
560536 }
561537
562- /**
563- * @expectedException \Symfony\Component\Routing\Exception\InvalidParameterException
564- */
565538 public function testUrlWithInvalidParameterInHost ()
566539 {
540+ $ this ->expectException ('Symfony\Component\Routing\Exception\InvalidParameterException ' );
567541 $ routes = $ this ->getRoutes ('test ' , new Route ('/ ' , [], ['foo ' => 'bar ' ], [], '{foo}.example.com ' ));
568542 $ this ->getGenerator ($ routes )->generate ('test ' , ['foo ' => 'baz ' ], UrlGeneratorInterface::ABSOLUTE_PATH );
569543 }
570544
571- /**
572- * @expectedException \Symfony\Component\Routing\Exception\InvalidParameterException
573- */
574545 public function testUrlWithInvalidParameterInHostWhenParamHasADefaultValue ()
575546 {
547+ $ this ->expectException ('Symfony\Component\Routing\Exception\InvalidParameterException ' );
576548 $ routes = $ this ->getRoutes ('test ' , new Route ('/ ' , ['foo ' => 'bar ' ], ['foo ' => 'bar ' ], [], '{foo}.example.com ' ));
577549 $ this ->getGenerator ($ routes )->generate ('test ' , ['foo ' => 'baz ' ], UrlGeneratorInterface::ABSOLUTE_PATH );
578550 }
579551
580- /**
581- * @expectedException \Symfony\Component\Routing\Exception\InvalidParameterException
582- */
583552 public function testUrlWithInvalidParameterEqualsDefaultValueInHost ()
584553 {
554+ $ this ->expectException ('Symfony\Component\Routing\Exception\InvalidParameterException ' );
585555 $ routes = $ this ->getRoutes ('test ' , new Route ('/ ' , ['foo ' => 'baz ' ], ['foo ' => 'bar ' ], [], '{foo}.example.com ' ));
586556 $ this ->getGenerator ($ routes )->generate ('test ' , ['foo ' => 'baz ' ], UrlGeneratorInterface::ABSOLUTE_PATH );
587557 }
0 commit comments