@@ -23,7 +23,7 @@ public function testRedirectWhenNoSlash()
23
23
$ coll ->add ('foo ' , new Route ('/foo/ ' ));
24
24
25
25
$ matcher = $ this ->getMockForAbstractClass ('Symfony\Component\Routing\Matcher\RedirectableUrlMatcher ' , array ($ coll , new RequestContext ()));
26
- $ matcher ->expects ($ this ->once ())->method ('redirect ' );
26
+ $ matcher ->expects ($ this ->once ())->method ('redirect ' )-> will ( $ this -> returnValue ( array ())) ;
27
27
$ matcher ->match ('/foo ' );
28
28
}
29
29
@@ -68,7 +68,7 @@ public function testNoSchemaRedirectIfOnOfMultipleSchemesMatches()
68
68
$ matcher ->match ('/foo ' );
69
69
}
70
70
71
- public function testRedirectWithParams ()
71
+ public function testSchemeRedirectWithParams ()
72
72
{
73
73
$ coll = new RouteCollection ();
74
74
$ coll ->add ('foo ' , new Route ('/foo/{bar} ' , array (), array (), array (), '' , array ('https ' )));
@@ -78,8 +78,23 @@ public function testRedirectWithParams()
78
78
->expects ($ this ->once ())
79
79
->method ('redirect ' )
80
80
->with ('/foo/baz ' , 'foo ' , 'https ' )
81
- ->will ($ this ->returnValue (array ('_route ' => 'foo ' )))
81
+ ->will ($ this ->returnValue (array ('redirect ' => 'value ' )))
82
+ ;
83
+ $ this ->assertEquals (array ('_route ' => 'foo ' , 'bar ' => 'baz ' , 'redirect ' => 'value ' ), $ matcher ->match ('/foo/baz ' ));
84
+ }
85
+
86
+ public function testSlashRedirectWithParams ()
87
+ {
88
+ $ coll = new RouteCollection ();
89
+ $ coll ->add ('foo ' , new Route ('/foo/{bar}/ ' ));
90
+
91
+ $ matcher = $ this ->getMockForAbstractClass ('Symfony\Component\Routing\Matcher\RedirectableUrlMatcher ' , array ($ coll , new RequestContext ()));
92
+ $ matcher
93
+ ->expects ($ this ->once ())
94
+ ->method ('redirect ' )
95
+ ->with ('/foo/baz/ ' , 'foo ' , null )
96
+ ->will ($ this ->returnValue (array ('redirect ' => 'value ' )))
82
97
;
83
- $ this ->assertEquals (array ('_route ' => 'foo ' , 'bar ' => 'baz ' ), $ matcher ->match ('/foo/baz ' ));
98
+ $ this ->assertEquals (array ('_route ' => 'foo ' , 'bar ' => 'baz ' , ' redirect ' => ' value ' ), $ matcher ->match ('/foo/baz ' ));
84
99
}
85
100
}
0 commit comments