删除话题 最后断言 404 失败?
预期的是404 为啥会返回200呢??
Expected status code 404 but received 200.
Failed asserting that false is true.
/home/vagrant/Code/Laravel/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:78
/home/vagrant/Code/Laravel/tests/Feature/TopicApiTest.php:104
FAILURES!
Tests: 7, Assertions: 22, Failures: 1.
public function testDeleteTopic()
{
$topic = $this->makeTopic();
$response = $this->JWTActingAs($this->user)
->json('DELETE', '/api/topics/'.$topic->id);
$response->assertStatus(204);
$response = $this->json('GET', '/api/topics/'.$topic->id);
$response->assertStatus(404);
}
推荐文章: