added unit tests
This commit is contained in:
22
tests/Integration/ApiRoutingTest.php
Normal file
22
tests/Integration/ApiRoutingTest.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Integration;
|
||||
|
||||
use Tests\Support\QdbTestCase;
|
||||
|
||||
final class ApiRoutingTest extends QdbTestCase
|
||||
{
|
||||
public function testUnknownRoute404(): void
|
||||
{
|
||||
$res = $this->api()->request('GET', 'does-not-exist');
|
||||
$this->assertApiError($res, 'NOT_FOUND', 404);
|
||||
}
|
||||
|
||||
public function testUnauthorizedWithoutToken(): void
|
||||
{
|
||||
$res = $this->api()->request('GET', 'questionnaires');
|
||||
$this->assertApiError($res, 'UNAUTHORIZED', 401);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user