test(state): mark the deprecated serializer-aware provider test#8426
Open
soyuka wants to merge 1 commit into
Open
test(state): mark the deprecated serializer-aware provider test#8426soyuka wants to merge 1 commit into
soyuka wants to merge 1 commit into
Conversation
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.
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.
Fixes the
PHPUnit (PHP 8.5) (no deprecations)job, which runsvendor/bin/phpunit --fail-on-deprecation --display-deprecationsand currently reports:Why
The
SerializableProvidertest fixture implementsSerializerAwareProviderInterface.DataProviderPasstherefore adds asetSerializerLocator()method call to its definition, and the trait triggers the 4.2 deprecation when the service is instantiated during the request.The deprecation is correct and intentional — the interface still ships in 4.3 and is only removed in 5.0, so the code path must stay covered. Only the test needs to declare that it exercises a deprecated feature.
Change
#[IgnoreDeprecations]plusexpectUserDeprecationMessage()on the test, following the convention already used intests/Functional/EnumDenormalizationValidationTest.php. Using the expectation rather than a bare ignore keeps the deprecation asserted, so it will be noticed when the interface is dropped in 5.0.Verified locally
--fail-on-deprecation --display-deprecationswithignoreIndirectDeprecations="false"The expectation is satisfied under both settings, so it does not depend on how the deprecation is categorised.
Note: this is the only remaining red check on #8425.