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 3ebd90064..1ab30384e 100644 --- a/app/Containers/AppSection/Authentication/UI/API/Tests/Functional/GetAuthenticatedUserTest.php +++ b/app/Containers/AppSection/Authentication/UI/API/Tests/Functional/GetAuthenticatedUserTest.php @@ -36,6 +36,27 @@ public function testGetAuthenticatedUser(): void 'name' => $user->name, 'gender' => $user->gender, 'birth' => $user->birth, + ]); + $this->assertEquals($user->name, $responseContent->data->name); + } + + public function testGetAuthenticatedUserAsAdmin(): void + { + $user = $this->getTestingUser(createUserAsAdmin: true); + + $response = $this->makeCall(); + + $response->assertStatus(200); + $responseContent = $this->getResponseContentObject(); + $this->assertResponseContainKeyValue([ + 'object' => 'User', + 'id' => $user->getHashedKey(), + 'email' => $user->email, + 'email_verified_at' => $user->email_verified_at, + 'name' => $user->name, + 'gender' => $user->gender, + 'birth' => $user->birth, + 'real_id' => $user->id, 'created_at' => $user->created_at, 'updated_at' => $user->updated_at, 'readable_created_at' => $user->created_at->diffForHumans(),