2015-06-19 113 views
0

我想测试我的命名路由重定向到他们应该的URL。例如:Laravel 5测试路由

get('users/profile', ['uses' => '[email protected]', 'as' => 'users.profile']); 

我怎么能断言users.profile确实重定向到users/profile和被调用的方法确实UserController#profile()

回答

0

如果我没有弄错,你可以使用Request类,如果你在你的单元测试中使用facade,可以调用Request :: is('users/profile')。否则,请实例化Request类或直接调用Facade。

不知道这是你在找什么,但这是我最好的拍摄。