Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammad-Alavi committed Feb 7, 2022
1 parent 1fcd9ab commit e0dd595
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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);
}
}

0 comments on commit e0dd595

Please sign in to comment.