0
我想测试我的命名路由重定向到他们应该的URL。例如:Laravel 5测试路由
get('users/profile', ['uses' => '[email protected]', 'as' => 'users.profile']);
我怎么能断言users.profile
确实重定向到users/profile
和被调用的方法确实UserController#profile()
?
我想测试我的命名路由重定向到他们应该的URL。例如:Laravel 5测试路由
get('users/profile', ['uses' => '[email protected]', 'as' => 'users.profile']);
我怎么能断言users.profile
确实重定向到users/profile
和被调用的方法确实UserController#profile()
?
如果我没有弄错,你可以使用Request
类,如果你在你的单元测试中使用facade,可以调用Request :: is('users/profile')。否则,请实例化Request类或直接调用Facade。
不知道这是你在找什么,但这是我最好的拍摄。