From e49c2d882a404283d555c04cd40baaed91240e68 Mon Sep 17 00:00:00 2001 From: Abby Date: Wed, 12 Jan 2022 10:41:43 +0000 Subject: [PATCH] updated the authentication get return type and included test --- src/Authentication.php | 2 +- src/InspiredDeckAuth.php | 4 +--- tests/Unit/AuthenticationTest.php | 8 ++++++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Authentication.php b/src/Authentication.php index 97b28b5..435594c 100644 --- a/src/Authentication.php +++ b/src/Authentication.php @@ -38,7 +38,7 @@ public function __construct(InspiredDeckAuth $authResource = null) * * @return mixed */ - public function get(): array + public function get() { return Session::get($this->sessionKey, false); } diff --git a/src/InspiredDeckAuth.php b/src/InspiredDeckAuth.php index ec408d2..ee7b0f8 100644 --- a/src/InspiredDeckAuth.php +++ b/src/InspiredDeckAuth.php @@ -6,9 +6,7 @@ interface InspiredDeckAuth { /** - * Get the currently Authenticated User - * * @return mixed */ - public function get(): array; + public function get(); } \ No newline at end of file diff --git a/tests/Unit/AuthenticationTest.php b/tests/Unit/AuthenticationTest.php index 67b2c99..42ac983 100644 --- a/tests/Unit/AuthenticationTest.php +++ b/tests/Unit/AuthenticationTest.php @@ -36,6 +36,14 @@ public function can_authenticate(): void $this->assertTrue($response); } + /** @test **/ + public function check_that_authentication_can_return_false(): void + { + $authentication = new Authentication(); + + $this->assertFalse($authentication->get()); + } + /** @test **/ public function login_stores_authentication_in_session(): void {