@@ -949,27 +949,28 @@ public function testRedirectRoute(
949949 string $ url ,
950950 string $ expectedPath ,
951951 string $ alias ,
952+ int $ status = 302 ,
952953 ): void {
953954 $ collection = clone $ this ->collection ;
954955 $ collection ->resetRoutes ();
955956
956957 $ collection ->get ($ route , 'Controller::method ' , ['as ' => $ alias ]);
957- $ collection ->addRedirect ($ redirectFrom , $ redirectTo );
958+ $ collection ->addRedirect ($ redirectFrom , $ redirectTo, $ status );
958959
959960 $ this ->expectException (RedirectException::class);
960961 $ this ->expectExceptionMessage ($ expectedPath );
961- $ this ->expectExceptionCode (302 );
962+ $ this ->expectExceptionCode ($ status );
962963
963964 $ router = new Router ($ collection , $ this ->request );
964965 $ router ->handle ($ url );
965966 }
966967
967968 /**
968- * @return iterable<int, array{string, string, string, string, string, string}>
969+ * @return iterable<int, array{string, string, string, string, string, string, 6?: int }>
969970 */
970971 public static function provideRedirectRoute (): iterable
971972 {
972- // [$route, $redirectFrom, $redirectTo, $url, $expectedPath, $alias]
973+ // [$route, $redirectFrom, $redirectTo, $url, $expectedPath, $alias, $status ]
973974 return [
974975 ['posts ' , 'articles ' , 'posts ' , '/articles ' , 'posts ' , 'alias ' ],
975976 ['posts ' , 'articles ' , 'alias ' , '/articles ' , 'posts ' , 'alias ' ],
@@ -979,6 +980,7 @@ public static function provideRedirectRoute(): iterable
979980 ['post/(:segment)/comment/(:any) ' , 'article/(:num)/(:any) ' , 'alias ' , '/article/1/2 ' , 'post/1/comment/2 ' , 'alias ' ],
980981 ['posts ' , '{locale}/articles ' , 'posts ' , '/en/articles ' , 'posts ' , 'alias ' ],
981982 ['{locale}/posts ' , '{locale}/articles ' , '{locale}/posts ' , '/en/articles ' , 'en/posts ' , 'alias ' ],
983+ ['{locale}/posts ' , '{locale}/articles ' , '{locale}/posts ' , '/en/articles ' , 'en/posts ' , 'alias ' , 301 ],
982984 ['{locale}/posts ' , '{locale}/articles ' , 'alias ' , '/en/articles ' , 'en/posts ' , 'alias ' ],
983985 ['{locale}/post/(:num) ' , '{locale}/article/(:num) ' , '{locale}/post/$1 ' , '/en/article/1 ' , 'en/post/1 ' , 'alias ' ],
984986 ['{locale}/post/(:num) ' , '{locale}/article/(:num) ' , 'alias ' , '/en/article/1 ' , 'en/post/1 ' , 'alias ' ],
0 commit comments