我想测试我的命名路由,重定向到它们应该指向的URL。例如:
get('users/profile', ['uses' => 'UserController@profile', 'as' => 'users.profile']);我如何断言users.profile确实重定向到了users/profile,并且被调用的方法确实是UserController#profile()呢?
发布于 2015-06-20 00:56:01
如果我没记错的话,如果在单元测试中使用外观,您可以使用Request类并调用Request::is('users/profile')。否则,要么实例化请求类,要么直接调用外观。
不知道这是不是你要找的,但这是我最好的选择。
https://stackoverflow.com/questions/30942950
复制相似问题