From 23e0a27f9ae343e4109076d706a8130c4e904107 Mon Sep 17 00:00:00 2001 From: philipp lang <philipp@aweos.de> Date: Wed, 17 Nov 2021 00:33:45 +0100 Subject: [PATCH] Fixed: Resolve login from cache --- tests/Feature/LoginTest.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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);