test: use Response:: enum for HTTP status code

This commit is contained in:
Maël Gangloff
2025-12-11 10:53:08 +01:00
parent 0de6c7a132
commit 8a3ba9eb52
6 changed files with 22 additions and 16 deletions

View File

@@ -9,6 +9,7 @@ use App\Factory\UserFactory;
use App\Tests\AuthenticatedUserTrait;
use App\Tests\Service\RDAPServiceTest;
use PHPUnit\Framework\Attributes\DependsExternal;
use Symfony\Component\HttpFoundation\Response;
use Zenstruck\Foundry\Test\Factories;
final class WatchlistUpdateProcessorTest extends ApiTestCase
@@ -21,7 +22,7 @@ final class WatchlistUpdateProcessorTest extends ApiTestCase
{
self::createUserAndWatchlist();
$this->assertResponseIsSuccessful();
$this->assertResponseStatusCodeSame(201);
$this->assertResponseStatusCodeSame(Response::HTTP_CREATED);
$this->assertMatchesResourceItemJsonSchema(Watchlist::class);
}
@@ -31,7 +32,7 @@ final class WatchlistUpdateProcessorTest extends ApiTestCase
$client = self::createClientWithCredentials(self::getToken(UserFactory::createOne()));
self::createUserAndWatchlist($client);
self::createUserAndWatchlist($client);
$this->assertResponseStatusCodeSame(403);
$this->assertResponseStatusCodeSame(Response::HTTP_FORBIDDEN);
}
#[DependsExternal(RDAPServiceTest::class, 'testUpdateRdapServers')]