@@ -553,6 +553,44 @@ public function testCacheValidityWithContainerParameters($parameter)
553
553
}
554
554
}
555
555
556
+ public function testResolvingSchemes ()
557
+ {
558
+ $ routes = new RouteCollection ();
559
+
560
+ $ route = new Route ('/test ' , [], [], [], '' , ['%parameter.http% ' , '%parameter.https% ' ]);
561
+ $ routes ->add ('foo ' , $ route );
562
+
563
+ $ sc = $ this ->getPsr11ServiceContainer ($ routes );
564
+ $ parameters = $ this ->getParameterBag ([
565
+ 'parameter.http ' => 'http ' ,
566
+ 'parameter.https ' => 'https ' ,
567
+ ]);
568
+
569
+ $ router = new Router ($ sc , 'foo ' , [], null , $ parameters );
570
+ $ route = $ router ->getRouteCollection ()->get ('foo ' );
571
+
572
+ $ this ->assertEquals (['http ' , 'https ' ], $ route ->getSchemes ());
573
+ }
574
+
575
+ public function testResolvingMethods ()
576
+ {
577
+ $ routes = new RouteCollection ();
578
+
579
+ $ route = new Route ('/test ' , [], [], [], '' , [], ['%parameter.get% ' , '%parameter.post% ' ]);
580
+ $ routes ->add ('foo ' , $ route );
581
+
582
+ $ sc = $ this ->getPsr11ServiceContainer ($ routes );
583
+ $ parameters = $ this ->getParameterBag ([
584
+ 'PARAMETER.GET ' => 'GET ' ,
585
+ 'PARAMETER.POST ' => 'POST ' ,
586
+ ]);
587
+
588
+ $ router = new Router ($ sc , 'foo ' , [], null , $ parameters );
589
+ $ route = $ router ->getRouteCollection ()->get ('foo ' );
590
+
591
+ $ this ->assertEquals (['GET ' , 'POST ' ], $ route ->getMethods ());
592
+ }
593
+
556
594
public function getContainerParameterForRoute ()
557
595
{
558
596
yield 'String ' => ['"foo" ' ];
0 commit comments