This commit is contained in:
48
tests/Integration/UsersTest.php
Normal file
48
tests/Integration/UsersTest.php
Normal file
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
|
||||
|
||||
namespace Tests\Integration;
|
||||
|
||||
|
||||
|
||||
use Tests\Support\ApiTestCase;
|
||||
|
||||
use Tests\Support\DatabaseFixture;
|
||||
|
||||
|
||||
|
||||
final class UsersTest extends ApiTestCase
|
||||
|
||||
{
|
||||
|
||||
public function testRequiresAuth(): void
|
||||
|
||||
{
|
||||
|
||||
$res = $this->api('GET', 'users');
|
||||
|
||||
$this->assertLegacyAuthError($res, 401, 'Missing Bearer token');
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function testCoachForbidden(): void
|
||||
|
||||
{
|
||||
|
||||
$this->loginAs(DatabaseFixture::COACH1_USERNAME);
|
||||
|
||||
$res = $this->api('GET', 'users');
|
||||
|
||||
$this->assertLegacyAuthError($res, 403, 'Insufficient permissions');
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user