diff --git a/tests/Feature/LoginTest.php b/tests/Feature/LoginTest.php index 0e3b868d..de398844 100644 --- a/tests/Feature/LoginTest.php +++ b/tests/Feature/LoginTest.php @@ -53,6 +53,26 @@ class LoginTest extends TestCase Http::assertSentCount(2); } + public function testItResolvesTheLoginFromTheCache() + { + $this->withoutExceptionHandling(); + app('nami.backend')->fakeLogin(123, [], 'cookie-123'); + + $this->post('/login', [ + 'mglnr' => 123, + 'password' => 'secret' + ]); + auth()->setUser(null); + $this->post('/login', [ + 'mglnr' => 123, + 'password' => 'secret' + ]); + + $this->assertTrue(auth()->check()); + + Http::assertSentCount(2); + } + public function testItThrowsExceptionWhenLoginFailed() { app('nami.backend')->fakeFailedLogin(123);