2015-06-19 114 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。

不知道這是你在找什麼,但這是我最好的拍攝。