[Sets] Drop the PHPUnit 12.0, 12.5 and 13.0 triggered sets covered by composer-based - #757
Closed
TomasVotruba wants to merge 1 commit into
Closed
[Sets] Drop the PHPUnit 12.0, 12.5 and 13.0 triggered sets covered by composer-based#757TomasVotruba wants to merge 1 commit into
TomasVotruba wants to merge 1 commit into
Conversation
… composer-based Every rule these three sets registered is already in composer-based.php, bound to the exact phpunit/phpunit version it needs: - 12.0: RemoveOverrideFinalConstructTestCaseRector (>=12.0.3), plus the mock-to-stub set and composer-based set it imports - 12.5: the three AllowMockObjects rules (>=12.5.2) - 13.0: the expectExceptionMessage() to expectExceptionMessageIsOrContains() rename (>=13.2) The bond is also more accurate than the set trigger was: a 13.0 or 13.1 project no longer gets the rename of a method that only exists from 13.2, and the same for 12.0 versus 12.0.3 and 12.5 versus 12.5.2. The set files stay reachable through the PHPUnitSetList constants.
This was referenced Aug 5, 2026
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.
Same cleanup as rectorphp/rector-symfony#1010, but PHPUnit turns out to be a much smaller case — most per-version sets are not covered by
composer-based.phpyet, so only three go.Checked all 11 triggered sets rule by rule against
config/sets/composer-based.php:RemoveOverrideFinalConstructTestCaseRector(>=12.0.3), plus the mock-to-stub and composer-based sets it imports — all 10 mock-to-stub rules are in composer-basedAllowMockObjects*rules (>=12.5.2)expectExceptionMessage()→expectExceptionMessageIsOrContains()rename (>=13.2)staticExpects()→expects()rename is not in composer-basedThe version bond is also more accurate than the set trigger it replaces. The set fired on
^13.0, while the method it renames to only exists from 13.2:Same for 12.0 vs 12.0.3 and 12.5 vs 12.5.2. A project on 13.0 or 13.1 no longer gets a rename to a method it does not have.
PHPUnitSetProviderstays — it still carries the 8 uncovered per-version sets, the composer-based trigger, and the Code Quality and PHPUnit Attributes sets. The three set files stay reachable throughPHPUnitSetList::PHPUNIT_120,PHPUNIT_125andPHPUNIT_130.Green locally: 652 tests, PHPStan and ECS clean.