【发布时间】:2020-09-03 23:08:46
【问题描述】:
我无法在 PHPUnit 中解决这个问题。在 Postman 中它运行良好,但在 PHPUnit 中出现错误。
class MyPageTakumoiTest extends TestCase
{
protected $api = "/api/my_page_takumoi/2";
public function testUpdate()
{
$response = $this->json('PUT', $this->api, [
'family_name' => 'new kk',
]);
$response->assertStatus(200);
}
}
Expected status code 200 but received 500.
Failed asserting that 200 is identical to 500.
【问题讨论】:
-
你有一些日志吗?状态 500 是一般错误状态...