这是我的代码laravel单元测试登录
public function testClientSucceslogin()
{
$user = factory(User::class)->create([
'password' => 'secret',
'status' => User::STATUS_ACTIVE,
'type' => User::TYPE_CLIENT
]);
$clientProfile = ClientProfile::where('client_id', $user->client_id)->first();
$client_alias = Client::where('id', $user->client_id)->first();
$this->get(route('login', [$user->email, $user->password]))
->assertStatus(200)
->assertRedirect('dashboard', [$client_alias->alias, $clientProfile->id])
->assertTrue(true);
}
我收到了这个错误
Response status code [200] is not a redirect status code. Failed asserting that false is true.
我将状态代码更改为302但我收到此错误
enter code heExpected status code 302 but received 200.
声明false为真的失败。
我如何解决这个问题?