From 408143d10561330ee5a5fdcdd8ff561f9d03a0c2 Mon Sep 17 00:00:00 2001 From: soyuka Date: Mon, 27 Jul 2026 09:55:52 +0200 Subject: [PATCH] test(state): mark the deprecated serializer-aware provider test SerializableProvider implements SerializerAwareProviderInterface, so DataProviderPass injects the serializer locator and the trait triggers its 4.2 deprecation when the service is instantiated. That makes the "no deprecations" job fail on a deprecation we ship on purpose until 5.0. Declare the expected deprecation on the test instead of dropping the fixture, so the deprecated code path stays covered. --- tests/Functional/JsonLd/SerializableItemDataProviderTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/Functional/JsonLd/SerializableItemDataProviderTest.php b/tests/Functional/JsonLd/SerializableItemDataProviderTest.php index d20032d311c..d104d93868b 100644 --- a/tests/Functional/JsonLd/SerializableItemDataProviderTest.php +++ b/tests/Functional/JsonLd/SerializableItemDataProviderTest.php @@ -16,6 +16,7 @@ use ApiPlatform\Symfony\Bundle\Test\ApiTestCase; use ApiPlatform\Tests\Fixtures\TestBundle\Model\SerializableResource; use ApiPlatform\Tests\SetupClassResourcesTrait; +use PHPUnit\Framework\Attributes\IgnoreDeprecations; final class SerializableItemDataProviderTest extends ApiTestCase { @@ -31,8 +32,11 @@ public static function getResources(): array return [SerializableResource::class]; } + #[IgnoreDeprecations] public function testGetSerializableResource(): void { + $this->expectUserDeprecationMessage('Since api-platform/core 4.2: The "ApiPlatform\State\SerializerAwareProviderInterface" interface is deprecated and will be removed in 5.0. It violates the dependency injection principle.'); + self::createClient()->request('GET', '/serializable_resources/1'); $this->assertResponseStatusCodeSame(200);