@@ -19,9 +19,7 @@ final class StaticRoutesSmokeTest extends WebTestCase
1919 public function testRoutesDoNotReturnInternalError (string $ httpMethod , string $ routeName , string $ routePath ): void
2020 {
2121 $ client = self ::createClient ();
22-
2322 $ client ->request ($ httpMethod , $ routePath );
24-
2523 $ response = $ client ->getResponse ();
2624 self ::assertLessThan (
2725 500 ,
@@ -39,9 +37,7 @@ public static function provideRouteCollection(): \Generator
3937
4038 /** @var RouterInterface $router */
4139 $ router = self ::getContainer ()->get (RouterInterface::class);
42-
4340 $ routes = $ router ->getRouteCollection ();
44-
4541 self ::ensureKernelShutdown ();
4642
4743 if (!$ routes ->count ()) {
@@ -57,8 +53,7 @@ public static function provideRouteCollection(): \Generator
5753 public static function extractRoutesFromRouter (RouterInterface $ router ): \Generator
5854 {
5955 foreach ($ router ->getRouteCollection () as $ routeName => $ route ) {
60- $ compiledRoute = $ route ->compile ();
61- $ variables = $ compiledRoute ->getVariables ();
56+ $ variables = $ route ->compile ()->getVariables ();
6257 if (\count ($ variables ) > 0 ) {
6358 $ defaults = $ route ->getDefaults ();
6459 $ defaultsKeys = array_keys ($ defaults );
@@ -71,6 +66,8 @@ public static function extractRoutesFromRouter(RouterInterface $router): \Genera
7166
7267 $ methods = $ route ->getMethods ();
7368 if (!$ methods ) {
69+ // If we get there, it is because your route doesn't have methods requirment.
70+ // You can add one by adding ` methods: ['GET']` to your Route attribute.
7471 $ methods [] = 'GET ' ;
7572 }
7673
0 commit comments