我正在尝试测试我的登录,但使用以下方法失败。为什么我无法登录用户有什么建议?
/** @test */
public function login_into_lerova()
{
$user = factory(User::class)->create([
'email' => 'max.mustermann@smartgate.ch',
'password' => bcrypt('normal'),
]);
$this->browse(function (Browser $browser) use ($user){
$browser->visit(url(route('login')))
->type('email', $user->email)
->type('password','normal')
->press('@login-button')
->assertAuthenticatedAs($user);
});
}
收到以下错误:
1) Tests\Browser\LoginTest::login_into_lerova
The currently authenticated user is not who was expected.
Failed asserting that Array &0 () is identical to Array &0 (
'id' => 1
'className' => 'App\User'
).
干杯, 斯坦