This commit is contained in:
25
tests/Integration/QuestionnairesTest.php
Normal file
25
tests/Integration/QuestionnairesTest.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Integration;
|
||||
|
||||
use Tests\Support\ApiTestCase;
|
||||
use Tests\Support\DatabaseFixture;
|
||||
|
||||
final class QuestionnairesTest extends ApiTestCase
|
||||
{
|
||||
public function testRequiresAuth(): void
|
||||
{
|
||||
$res = $this->api('GET', 'questionnaires');
|
||||
$this->assertLegacyAuthError($res, 401, 'Missing Bearer token');
|
||||
}
|
||||
|
||||
public function testAdminCanListQuestionnaires(): void
|
||||
{
|
||||
$this->loginAs(DatabaseFixture::ADMIN_USERNAME);
|
||||
$res = $this->api('GET', 'questionnaires');
|
||||
$this->assertOk($res);
|
||||
$this->assertNotEmpty($res['body']['data']['questionnaires'] ?? []);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user