Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions tests/Functional/EnumDenormalizationValidationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
use ApiPlatform\Tests\Fixtures\TestBundle\ApiResource\EnumValidationResource;
use ApiPlatform\Tests\SetupClassResourcesTrait;
use Composer\InstalledVersions;
use Composer\Semver\VersionParser;
use PHPUnit\Framework\Attributes\IgnoreDeprecations;

/**
* @see https://github.com/api-platform/core/issues/8183
Expand Down Expand Up @@ -67,13 +65,8 @@ public function testInvalidBackedEnumValueProducesValidationViolation(): void
$this->assertNotNull($genderViolation, 'Expected a constraint violation on "gender" property.');
}

#[IgnoreDeprecations]
public function testInvalidBackedEnumValueWithCollectDenormalizationErrors(): void
{
if (InstalledVersions::satisfies(new VersionParser(), 'symfony/serializer', '>=8.1')) {
$this->expectUserDeprecationMessage('Since symfony/serializer 8.1: The "Symfony\Component\Serializer\Exception\PartialDenormalizationException::getErrors()" method is deprecated, use "Symfony\Component\Serializer\Exception\PartialDenormalizationException::getNotNormalizableValueErrors()" instead.');
}

$response = static::createClient()->request('POST', '/enum_validation_resources_collect', [
'headers' => ['Content-Type' => 'application/ld+json'],
'json' => ['gender' => 'unknown'],
Expand Down
8 changes: 0 additions & 8 deletions tests/Functional/NullOnNonNullablePropertyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
use ApiPlatform\Symfony\Bundle\Test\ApiTestCase;
use ApiPlatform\Tests\Fixtures\TestBundle\ApiResource\NullOnNonNullableProperty\NullOnNonNullableResource;
use ApiPlatform\Tests\SetupClassResourcesTrait;
use Composer\InstalledVersions;
use Composer\Semver\VersionParser;
use PHPUnit\Framework\Attributes\IgnoreDeprecations;

/** @see https://github.com/symfony/symfony/issues/64159 */
final class NullOnNonNullablePropertyTest extends ApiTestCase
Expand Down Expand Up @@ -48,13 +45,8 @@ public function testNullOnNonNullablePropertyReturns400(): void
$this->assertStringContainsString('Expected argument of type "string", "null" given at property path "name"', $body['hydra:description'] ?? $body['detail'] ?? '');
}

#[IgnoreDeprecations]
public function testNullOnNonNullablePropertyReturns422WhenCollectingErrors(): void
{
if (InstalledVersions::satisfies(new VersionParser(), 'symfony/serializer', '>=8.1')) {
$this->expectUserDeprecationMessage('Since symfony/serializer 8.1: The "Symfony\Component\Serializer\Exception\PartialDenormalizationException::getErrors()" method is deprecated, use "Symfony\Component\Serializer\Exception\PartialDenormalizationException::getNotNormalizableValueErrors()" instead.');
}

$response = self::createClient()->request('POST', '/null_on_non_nullable_resources_collect', [
'headers' => ['Content-Type' => 'application/ld+json'],
'json' => ['name' => null],
Expand Down
Loading