chore: enforce camelCase PHPUnit method names - #95
Merged
Conversation
Every package but image already named its test methods in camelCase, so the convention existed by habit rather than by rule and nothing stopped it drifting. Pint's php_unit_method_casing fixer settles it: the wrong form is corrected on write instead of waiting for someone to spot it in review. Turning the rule on renames image's 39 test methods, which is the whole of the rest of this change. Nothing references them by name — the only DataProvider attribute names a provider, not a test — and the suite passes unchanged at 56 tests and 358 assertions. Pint reported braces_position and single_line_empty_body alongside the casing fixer, but those touch only the signature lines it was already rewriting; the diff is renames. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Every package except
imagealready used camelCase test method names, so the convention existed by habit rather than by rule — nothing stopped it drifting back.pint.jsongains one rule:Now the wrong form is corrected on write rather than waiting for someone to notice it in review.
What it changes
Turning the rule on renames
image's 39 test methods, which is the rest of the diff:Nothing references them by name — the file's only
#[DataProvider]names a provider method, not a test — and there are no@depends, no string references and nophpunit.xmlfilters. The suite passes unchanged: 56 tests, 358 assertions.Pint also reported
braces_positionandsingle_line_empty_bodyon that file, but those only touch the signature lines it was already rewriting. The diff is renames.Verified
vendor/bin/pint --testpasses repo-wide, and passed onmainbeforehand too, so the rule is the only thing this introducesbin/monorepo check image,test imageandvalidateall passpublic function test_remains anywhere inpackages/*/testsNote
I originally raised this thinking
poolsalso had snake_case methods. It does not —poolswas already camelCase onmain, andimageis the only package that needed fixing.🤖 Generated with Claude Code