diff --git a/app/Containers/AppSection/Authentication/UI/API/Tests/Functional/GetAuthenticatedUserTest.php b/app/Containers/AppSection/Authentication/UI/API/Tests/Functional/GetAuthenticatedUserTest.php index e48e21509..20eeeba7b 100644 --- a/app/Containers/AppSection/Authentication/UI/API/Tests/Functional/GetAuthenticatedUserTest.php +++ b/app/Containers/AppSection/Authentication/UI/API/Tests/Functional/GetAuthenticatedUserTest.php @@ -3,6 +3,7 @@ namespace App\Containers\AppSection\Authentication\UI\API\Tests\Functional; use App\Containers\AppSection\Authentication\UI\API\Tests\ApiTestCase; +use App\Containers\AppSection\User\Models\User; /** * Class GetAuthenticatedUserTest. @@ -42,4 +43,13 @@ public function testGetAuthenticatedUser(): void ]); $this->assertEquals($user->name, $responseContent->data->name); } + + public function testGetAuthenticatedUser_ByUnauthenticatedUser(): void + { + $this->testingUser = User::factory()->create(); + + $response = $this->auth(false)->makeCall(); + + $response->assertStatus(401); + } }