From b5f3daff63744a7d7517555cabda086f5d63df08 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Sun, 13 Jun 2021 15:41:51 +0200 Subject: [PATCH] Add loginTest --- tests/Feature/LoginTest.php | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tests/Feature/LoginTest.php diff --git a/tests/Feature/LoginTest.php b/tests/Feature/LoginTest.php new file mode 100644 index 00000000..71e8de43 --- /dev/null +++ b/tests/Feature/LoginTest.php @@ -0,0 +1,35 @@ +withoutExceptionHandling(); + $this->fakeNamiMembers([ + [ 'gruppierungId' => 11222, 'vorname' => 'Max', 'id' => 123 ] + ]); + $this->fakeNamiPassword(123, 'secret', [11222]); + + $this->post('/login', [ + 'groupid' => 11222, + 'mglnr' => 123, + 'password' => 'secret' + ]); + + $cache = Cache::get('namicookie-123'); + $this->assertEquals('JSESSIONID', data_get($cache, 'cookie.0.Name')); + $this->assertEquals('123', data_get($cache, 'data.mitgliedsnr')); + } +}