【发布时间】:2017-09-05 13:35:47
【问题描述】:
我为 laravel 的登录编写了这个单元测试
class LoginTest extends TestCase
{
/** @test */
public function auth()
{
$this->withoutMiddleware();
$this->visit('/login')
->post('/login', ['example@example.com', "password"=>"1234"])
->seeJson([
"login"=>"true"
]);
$this->get('/dashboard');
}
}
但我得到了这个错误
Invalid JSON was returned from the route. Perhaps an exception was thrown?
我该如何解决这个问题?
【问题讨论】:
标签: json laravel unit-testing laravel-5 login