[MigrateAtToConsecutiveExpectationsRector] Deprecate rule as way too ambiguous paths to upgrade and breaking, better handle manually #44
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.
After 3 hours of trying to fix the issue and looking at original PHPUnit issue with over 14 participants, sebastianbergmann/phpunit#4297, this Rector rule took too big piece of pie.
I checked the Moodle project that upgrade their tests - stronk7/moodle@e4f1c43, and there is many way to handle this upgrade. Most of them are:
But there are couple other way, like:
// 8 changes +$this->exactly();
or:
// 3 changes +->withConsecutive(
Which is interesting, because the
->withConsecutive()
was actually default solution for Rector, but here it's rather edge case.There is no clear way to upgrade this A → B. We should leave this to the end-user and PHPStorm find + replace with fixing failing test case process. It's better to handle manually to avoid random breaks.
That's why this rule is removed.
Closes rectorphp/rector#6976, cc @umpirsky