test: drop stale serializer 8.1 getErrors() deprecation expectation#8287
Merged
soyuka merged 1 commit intoJun 13, 2026
Merged
Conversation
Violation factories use method_exists(getNotNormalizableValueErrors) since api-platform#8211, so the deprecated getErrors() is never called on symfony/serializer >=8.1. The deprecation no longer fires, making the expectUserDeprecationMessage assertion fail with "not triggered". Remove the expectation from both tests plus the now-unused VersionParser/InstalledVersions/IgnoreDeprecations imports. Refs api-platform#8211
soyuka
added a commit
that referenced
this pull request
Jul 12, 2026
… test The 3-way merge of #8389 correctly dropped the deprecation-expectation guard (imports + #[IgnoreDeprecations] + version check) that #8287 had already removed from the sibling test, since 4.4's DenormalizationViolationFactory prefers getNotNormalizableValueErrors() over the deprecated getErrors() whenever it exists and so never triggers that deprecation on symfony/serializer >=8.1. But #8389 also introduced a brand-new test reusing the same now-unimported VersionParser/IgnoreDeprecations symbols, which the textual merge could not reconcile: it left the merged file referencing classes with no matching use statement. Remove the same stale guard from the new test for the same reason #8287 removed it from the old one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
mainCI fails on PHP 8.4/8.5 (all DB + Symfony variants) with 2 test failures:EnumDenormalizationValidationTest::testInvalidBackedEnumValueWithCollectDenormalizationErrorsNullOnNonNullablePropertyTest::testNullOnNonNullablePropertyReturns422WhenCollectingErrorsBoth:
Cause
Since #8211 the denormalization violation factories
(
src/Validator/DenormalizationViolationFactory.php,src/Laravel/State/DenormalizationViolationFactory.php) guard the call:On
symfony/serializer >=8.1the new method exists, so the deprecatedgetErrors()is never called and the deprecation never fires. TheexpectUserDeprecationMessageassertions are stale — production code wasfixed to avoid the deprecation, but the expectations weren't removed.
Fix
Remove the
expectUserDeprecationMessageblocks from both tests plus thenow-unused
VersionParser/InstalledVersions/IgnoreDeprecationsimports.
Verified against
symfony/serializer:^8.1(4/4 pass) and unchanged on8.0 (the block was already skipped there). php-cs-fixer clean.
Refs #8211