Skip to content

[1.x] Enforce snake_case methods for PHPUnit method in Laravel preset#300

Merged
taylorotwell merged 2 commits into
mainfrom
phpunit-casing
Oct 10, 2024
Merged

[1.x] Enforce snake_case methods for PHPUnit method in Laravel preset#300
taylorotwell merged 2 commits into
mainfrom
phpunit-casing

Conversation

@timacdonald

Copy link
Copy Markdown
Member

The Laravel preset should have an opinion on testsuite method casing.

There is always overhead involved working out what casing the testsuite is using. Often there can be multiple casings within a single testsuite. Even in our own ecosystem's packages, when contributions come from different people, we can see different casings within the one project.

The Laravel framework ships with snake casing, so I am proposing we stick with that and never have to waste brain cycles on this again for PHPUnit based testsuites.

Screenshot 2024-10-10 at 09 28 07

@timacdonald timacdonald changed the title [1.x] Use snake_case for PHPUnit method names [1.x] Enforce snake_case methods for PHPUnit method in Laravel preset Oct 9, 2024
@taylorotwell taylorotwell merged commit 0f732e0 into main Oct 10, 2024
@taylorotwell taylorotwell deleted the phpunit-casing branch October 10, 2024 13:29
@iBotPeaches

Copy link
Copy Markdown

Would this have made sense to become 1.19.0? - it seemed odd for a patch release (1.18.1 to 1.18.2) to throw thousands of errors since our test method names violated this default change.

@timacdonald

Copy link
Copy Markdown
Member Author

@iBotPeaches, we don't see adding rules to the Laravel preset as a breaking change.

You may lock the version of Pint used in your project to only introduce new rules when you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants