0
返回我写了这个登录单元测试的laravellaravel单元测试无效的JSON从路线
class LoginTest extends TestCase
{
/** @test */
public function auth()
{
$this->withoutMiddleware();
$this->visit('/login')
->post('/login', ['[email protected]', "password"=>"1234"])
->seeJson([
"login"=>"true"
]);
$this->get('/dashboard');
}
}
,但我得到这个错误
Invalid JSON was returned from the route. Perhaps an exception was thrown?
我怎么能解决这个问题呢?
我尝试第二个,但我得到了这个 错误:调用未定义的方法LoginTest :: getBody() – flower
然后请得到在我的答案中提到的枪库 – Learner