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