Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammad-Alavi committed Apr 8, 2022
1 parent 96f2bf8 commit a2e2639
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit a2e2639

Please sign in to comment.