diff --git a/tests/Entity/ProjectApi/GetOneTest.php b/tests/Entity/ProjectApi/GetOneTest.php index be6e378..d230de2 100644 --- a/tests/Entity/ProjectApi/GetOneTest.php +++ b/tests/Entity/ProjectApi/GetOneTest.php @@ -11,6 +11,7 @@ use App\Entity\Project\ProjectStatus; use App\Entity\Project\ProjectTerritory; use App\Entity\User\User; use Doctrine\ORM\EntityManagerInterface; +use Symfony\Component\HttpFoundation\Response; use Zenstruck\Foundry\Test\ResetDatabase; class GetOneTest extends ApiTestCase @@ -133,4 +134,15 @@ class GetOneTest extends ApiTestCase $this->assertResponseIsSuccessful(); } + + public function testGetOneWithInvalidToken(): void + { + static::createClient()->request( + 'GET', + $this->getUri(), + ['headers' => ['Authorization' => 'Bearer 123']] + ); + + $this->assertResponseStatusCodeSame(Response::HTTP_UNAUTHORIZED); + } }