File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ public function lastLogin(User $user): ?Login
6565 {
6666 return $ this ->where ('success ' , 1 )
6767 ->where ('user_id ' , $ user ->id )
68- ->orderBy ('date ' , 'desc ' )
68+ ->orderBy ('id ' , 'desc ' )
6969 ->first ();
7070 }
7171
Original file line number Diff line number Diff line change @@ -76,19 +76,23 @@ public function testLastLogin()
7676 // No logins found.
7777 $ this ->assertNull ($ this ->user ->lastLogin ());
7878
79- $ login = fake (
79+ $ login1 = fake (
8080 LoginModel::class,
8181 ['identifier ' => $ this ->user ->email , 'user_id ' => $ this ->user ->id ]
8282 );
83- fake (
83+ $ login2 = fake (
84+ LoginModel::class,
85+ ['identifier ' => $ this ->user ->email , 'user_id ' => $ this ->user ->id ]
86+ );
87+ $ login3 = fake (
8488 LoginModel::class,
8589 ['identifier ' => $ this ->user ->email , 'user_id ' => $ this ->user ->id , 'success ' => false ]
8690 );
8791
8892 $ last = $ this ->user ->lastLogin ();
8993
9094 $ this ->assertInstanceOf (Login::class, $ last ); // @phpstan-ignore-line
91- $ this ->assertSame ($ login ->id , $ last ->id );
95+ $ this ->assertSame ($ login2 ->id , $ last ->id );
9296 $ this ->assertInstanceOf (Time::class, $ last ->date );
9397 }
9498
You can’t perform that action at this time.
0 commit comments