Laravel 测试。错误预期状态代码为200,但收到200。如何修复它?
我为CompanyController创建了测试Laravel 测试。错误预期状态代码为200,但收到200。如何修复它?,laravel,laravel-testing,Laravel,Laravel Testing,我为CompanyController创建了测试 public function testCompanyIndex() { $user = factory(User::class)->create(); $response = $this->actingAs($user, 'web')->get('company/index'); $response->assertStatus('200'); } 但我有一
public function testCompanyIndex()
{
$user = factory(User::class)->create();
$response = $this->actingAs($user, 'web')->get('company/index');
$response->assertStatus('200');
}
但我有一个错误:
1) Tests\Feature\CompanyTest::testCompanyIndex
预期状态代码为200,但收到200。
断言false为true失败
在CompanyController中,我有中间件
auth:web
CompanyController@index
返回所有公司。只需删除这样的引号$response->assertStatus(200)代码>
有关更多详细信息,请单击仅删除类似以下内容的引号$response->assertStatus(200)代码>
有关更多详细信息,请单击“只需删除“”,如$response->assertStatus(200);只需像下面这样删除“”$response->assertStatus(200);好的,但是我怎么知道那个页面被下载了呢?好的,但是我怎么知道那个页面被下载了呢?