Repository navigation
refactor(tests): apply selected rector rules to tests - #14234
Draft
ChristophWurst wants to merge 6 commits into
Draft
ChristophWurst wants to merge 6 commits into
ChristophWurst wants to merge 6 commits into
Conversation
Test classes are not meant to be extended, so `final` states that and stops accidental inheritance between tests. Result of Rector's FinalizeTestCaseClassRector, which skips classes that have children. Assisted-by: ClaudeCode:claude-sonnet-5-5 Signed-off-by: Christoph Wurst <1374172+ChristophWurst@users.noreply.github.com>
Test methods return nothing, so declare it. Result of Rector's AddTestsVoidReturnTypeWhereNoReturnRector. Assisted-by: ClaudeCode:claude-sonnet-5-5 Signed-off-by: Christoph Wurst <1374172+ChristophWurst@users.noreply.github.com>
Test files without strict_types silently coerce scalar arguments, which can hide type errors in the code under test. Result of Rector's DeclareStrictTypesTestsRector on the 51 test files that lacked it. Assisted-by: ClaudeCode:claude-sonnet-5-5 Signed-off-by: Christoph Wurst <1374172+ChristophWurst@users.noreply.github.com>
Assisted-by: ClaudeCode:claude-sonnet-5-5 Signed-off-by: Christoph Wurst <1374172+ChristophWurst@users.noreply.github.com>
Data providers that return a large literal array build every row up front. Yielding them keeps one row per `yield` line and lets PHPUnit stream the data sets. Result of Rector's YieldDataProviderRector, followed by cs:fix. Assisted-by: ClaudeCode:claude-sonnet-5-5 Signed-off-by: Christoph Wurst <1374172+ChristophWurst@users.noreply.github.com>
…classes Assisted-by: ClaudeCode:claude-sonnet-5-5 Signed-off-by: Christoph Wurst <1374172+ChristophWurst@users.noreply.github.com>
This branch has not been deployed
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.
Context
Part of cleaning up the tests with Rector, split out of #14207 so each change can be reviewed and tested on its own. No ticket.
Approach
Each Rector rule gets its own commit, and the next one is only added once CI is green for the previous one:
: voidto test methodsDeliberately left out: the rest of the Rector output from #14207. Rules that rewrote tests incorrectly (callbacks, removed properties,
withConsecutive,self::to$this->) are skipped there and not applied here.Testing
CI only. The commits only touch
tests/.AI assistance
Assisted by ClaudeCode:claude-sonnet-5-5
Assisted by ClaudeCode:claude-sonnet-5-5