@@ -78,7 +78,7 @@ public function testRelativeUrlWithNullParameter()
78
78
79
79
public function testRelativeUrlWithNullParameterButNotOptional ()
80
80
{
81
- $ this ->expectException (' Symfony\Component\Routing\Exception\InvalidParameterException ' );
81
+ $ this ->expectException (\ Symfony \Component \Routing \Exception \InvalidParameterException::class );
82
82
$ routes = $ this ->getRoutes ('test ' , new Route ('/testing/{foo}/bar ' , ['foo ' => null ]));
83
83
// This must raise an exception because the default requirement for "foo" is "[^/]+" which is not met with these params.
84
84
// Generating path "/testing//bar" would be wrong as matching this route would fail.
@@ -264,14 +264,14 @@ public function testDumpWithLocalizedRoutesPreserveTheGoodLocaleInTheUrl()
264
264
265
265
public function testGenerateWithoutRoutes ()
266
266
{
267
- $ this ->expectException (' Symfony\Component\Routing\Exception\RouteNotFoundException ' );
267
+ $ this ->expectException (\ Symfony \Component \Routing \Exception \RouteNotFoundException::class );
268
268
$ routes = $ this ->getRoutes ('foo ' , new Route ('/testing/{foo} ' ));
269
269
$ this ->getGenerator ($ routes )->generate ('test ' , [], UrlGeneratorInterface::ABSOLUTE_URL );
270
270
}
271
271
272
272
public function testGenerateWithInvalidLocale ()
273
273
{
274
- $ this ->expectException (' Symfony\Component\Routing\Exception\RouteNotFoundException ' );
274
+ $ this ->expectException (\ Symfony \Component \Routing \Exception \RouteNotFoundException::class );
275
275
$ routes = new RouteCollection ();
276
276
277
277
$ route = new Route ('' );
@@ -293,21 +293,21 @@ public function testGenerateWithInvalidLocale()
293
293
294
294
public function testGenerateForRouteWithoutMandatoryParameter ()
295
295
{
296
- $ this ->expectException (' Symfony\Component\Routing\Exception\MissingMandatoryParametersException ' );
296
+ $ this ->expectException (\ Symfony \Component \Routing \Exception \MissingMandatoryParametersException::class );
297
297
$ routes = $ this ->getRoutes ('test ' , new Route ('/testing/{foo} ' ));
298
298
$ this ->getGenerator ($ routes )->generate ('test ' , [], UrlGeneratorInterface::ABSOLUTE_URL );
299
299
}
300
300
301
301
public function testGenerateForRouteWithInvalidOptionalParameter ()
302
302
{
303
- $ this ->expectException (' Symfony\Component\Routing\Exception\InvalidParameterException ' );
303
+ $ this ->expectException (\ Symfony \Component \Routing \Exception \InvalidParameterException::class );
304
304
$ routes = $ this ->getRoutes ('test ' , new Route ('/testing/{foo} ' , ['foo ' => '1 ' ], ['foo ' => 'd+ ' ]));
305
305
$ this ->getGenerator ($ routes )->generate ('test ' , ['foo ' => 'bar ' ], UrlGeneratorInterface::ABSOLUTE_URL );
306
306
}
307
307
308
308
public function testGenerateForRouteWithInvalidParameter ()
309
309
{
310
- $ this ->expectException (' Symfony\Component\Routing\Exception\InvalidParameterException ' );
310
+ $ this ->expectException (\ Symfony \Component \Routing \Exception \InvalidParameterException::class );
311
311
$ routes = $ this ->getRoutes ('test ' , new Route ('/testing/{foo} ' , [], ['foo ' => '1|2 ' ]));
312
312
$ this ->getGenerator ($ routes )->generate ('test ' , ['foo ' => '0 ' ], UrlGeneratorInterface::ABSOLUTE_URL );
313
313
}
@@ -323,7 +323,7 @@ public function testGenerateForRouteWithInvalidOptionalParameterNonStrict()
323
323
public function testGenerateForRouteWithInvalidOptionalParameterNonStrictWithLogger ()
324
324
{
325
325
$ routes = $ this ->getRoutes ('test ' , new Route ('/testing/{foo} ' , ['foo ' => '1 ' ], ['foo ' => 'd+ ' ]));
326
- $ logger = $ this ->getMockBuilder (' Psr\Log\LoggerInterface ' )->getMock ();
326
+ $ logger = $ this ->getMockBuilder (\ Psr \Log \LoggerInterface::class )->getMock ();
327
327
$ logger ->expects ($ this ->once ())
328
328
->method ('error ' );
329
329
$ generator = $ this ->getGenerator ($ routes , [], $ logger );
@@ -341,21 +341,21 @@ public function testGenerateForRouteWithInvalidParameterButDisabledRequirementsC
341
341
342
342
public function testGenerateForRouteWithInvalidMandatoryParameter ()
343
343
{
344
- $ this ->expectException (' Symfony\Component\Routing\Exception\InvalidParameterException ' );
344
+ $ this ->expectException (\ Symfony \Component \Routing \Exception \InvalidParameterException::class );
345
345
$ routes = $ this ->getRoutes ('test ' , new Route ('/testing/{foo} ' , [], ['foo ' => 'd+ ' ]));
346
346
$ this ->getGenerator ($ routes )->generate ('test ' , ['foo ' => 'bar ' ], UrlGeneratorInterface::ABSOLUTE_URL );
347
347
}
348
348
349
349
public function testGenerateForRouteWithInvalidUtf8Parameter ()
350
350
{
351
- $ this ->expectException (' Symfony\Component\Routing\Exception\InvalidParameterException ' );
351
+ $ this ->expectException (\ Symfony \Component \Routing \Exception \InvalidParameterException::class );
352
352
$ routes = $ this ->getRoutes ('test ' , new Route ('/testing/{foo} ' , [], ['foo ' => '\pL+ ' ], ['utf8 ' => true ]));
353
353
$ this ->getGenerator ($ routes )->generate ('test ' , ['foo ' => 'abc123 ' ], UrlGeneratorInterface::ABSOLUTE_URL );
354
354
}
355
355
356
356
public function testRequiredParamAndEmptyPassed ()
357
357
{
358
- $ this ->expectException (' Symfony\Component\Routing\Exception\InvalidParameterException ' );
358
+ $ this ->expectException (\ Symfony \Component \Routing \Exception \InvalidParameterException::class );
359
359
$ routes = $ this ->getRoutes ('test ' , new Route ('/{slug} ' , [], ['slug ' => '.+ ' ]));
360
360
$ this ->getGenerator ($ routes )->generate ('test ' , ['slug ' => '' ]);
361
361
}
@@ -476,7 +476,7 @@ public function testAdjacentVariables()
476
476
477
477
// The default requirement for 'x' should not allow the separator '.' in this case because it would otherwise match everything
478
478
// and following optional variables like _format could never match.
479
- $ this ->expectException (' Symfony\Component\Routing\Exception\InvalidParameterException ' );
479
+ $ this ->expectException (\ Symfony \Component \Routing \Exception \InvalidParameterException::class );
480
480
$ generator ->generate ('test ' , ['x ' => 'do.t ' , 'y ' => '123 ' , 'z ' => 'bar ' , '_format ' => 'xml ' ]);
481
481
}
482
482
@@ -517,7 +517,7 @@ public function testImportantVariable()
517
517
518
518
public function testImportantVariableWithNoDefault ()
519
519
{
520
- $ this ->expectException (' Symfony\Component\Routing\Exception\MissingMandatoryParametersException ' );
520
+ $ this ->expectException (\ Symfony \Component \Routing \Exception \MissingMandatoryParametersException::class );
521
521
$ routes = $ this ->getRoutes ('test ' , new Route ('/{page}.{!_format} ' ));
522
522
$ generator = $ this ->getGenerator ($ routes );
523
523
@@ -526,14 +526,14 @@ public function testImportantVariableWithNoDefault()
526
526
527
527
public function testDefaultRequirementOfVariableDisallowsSlash ()
528
528
{
529
- $ this ->expectException (' Symfony\Component\Routing\Exception\InvalidParameterException ' );
529
+ $ this ->expectException (\ Symfony \Component \Routing \Exception \InvalidParameterException::class );
530
530
$ routes = $ this ->getRoutes ('test ' , new Route ('/{page}.{_format} ' ));
531
531
$ this ->getGenerator ($ routes )->generate ('test ' , ['page ' => 'index ' , '_format ' => 'sl/ash ' ]);
532
532
}
533
533
534
534
public function testDefaultRequirementOfVariableDisallowsNextSeparator ()
535
535
{
536
- $ this ->expectException (' Symfony\Component\Routing\Exception\InvalidParameterException ' );
536
+ $ this ->expectException (\ Symfony \Component \Routing \Exception \InvalidParameterException::class );
537
537
$ routes = $ this ->getRoutes ('test ' , new Route ('/{page}.{_format} ' ));
538
538
$ this ->getGenerator ($ routes )->generate ('test ' , ['page ' => 'do.t ' , '_format ' => 'html ' ]);
539
539
}
@@ -561,21 +561,21 @@ public function testWithHostSameAsContextAndAbsolute()
561
561
562
562
public function testUrlWithInvalidParameterInHost ()
563
563
{
564
- $ this ->expectException (' Symfony\Component\Routing\Exception\InvalidParameterException ' );
564
+ $ this ->expectException (\ Symfony \Component \Routing \Exception \InvalidParameterException::class );
565
565
$ routes = $ this ->getRoutes ('test ' , new Route ('/ ' , [], ['foo ' => 'bar ' ], [], '{foo}.example.com ' ));
566
566
$ this ->getGenerator ($ routes )->generate ('test ' , ['foo ' => 'baz ' ], UrlGeneratorInterface::ABSOLUTE_PATH );
567
567
}
568
568
569
569
public function testUrlWithInvalidParameterInHostWhenParamHasADefaultValue ()
570
570
{
571
- $ this ->expectException (' Symfony\Component\Routing\Exception\InvalidParameterException ' );
571
+ $ this ->expectException (\ Symfony \Component \Routing \Exception \InvalidParameterException::class );
572
572
$ routes = $ this ->getRoutes ('test ' , new Route ('/ ' , ['foo ' => 'bar ' ], ['foo ' => 'bar ' ], [], '{foo}.example.com ' ));
573
573
$ this ->getGenerator ($ routes )->generate ('test ' , ['foo ' => 'baz ' ], UrlGeneratorInterface::ABSOLUTE_PATH );
574
574
}
575
575
576
576
public function testUrlWithInvalidParameterEqualsDefaultValueInHost ()
577
577
{
578
- $ this ->expectException (' Symfony\Component\Routing\Exception\InvalidParameterException ' );
578
+ $ this ->expectException (\ Symfony \Component \Routing \Exception \InvalidParameterException::class );
579
579
$ routes = $ this ->getRoutes ('test ' , new Route ('/ ' , ['foo ' => 'baz ' ], ['foo ' => 'bar ' ], [], '{foo}.example.com ' ));
580
580
$ this ->getGenerator ($ routes )->generate ('test ' , ['foo ' => 'baz ' ], UrlGeneratorInterface::ABSOLUTE_PATH );
581
581
}
0 commit comments