laravel-best-practices
laravel-best-practices copied to clipboard
Change test case methods to snake_case and mention Pest support
Update naming convention to match official Laravel documentation. (These "best practices" are currently out-of-step with modern Laravel standards.)
Reasoning:
- Laravel officially changed to snake_case for test case methods in version 8.0.
- Current Laravel documentation uses snake_case.
- All Laracast videos use snake_case.
- The previous discussion's reasoning to use camelCase for test case methods is no longer valid (aside from it not being PSR-12).
@alexeymezenin You seem to be engaging with this repo again... How about bringing it up to speed with current Laravel standards?
Snake case should be used in tests regardless Laravel.
It differs from regular methods and force developer to pay extreme attention to those. It differs from regular (app) methods that should be written following PSR standards. Personally, I comply/obey 100% PSR standards which means I use camelCase for methods, but for testing methods I use snake_case.