我正在使用 Lumen 6.0 构建项目,现在我必须编写一些测试。我试图确保在调用端点时存在验证错误,但是名为assertSessionHasErrors的方法不存在。
public function an_http_call_must_be_valid()
{
$response = $this->json('POST', $this->endpoint, [
'referrer' => 'web'
], $this->validHeaders);
$response->assertSessionHasErrors();
}
命令的输出:
./vendor/bin/phpunit
1) EmailNotificationTest::an_http_call_must_be_valid
Error: Call to undefined method EmailNotificationTest::assertSessionHasErrors()
任何想法?