We join a variety of Laravel projects each year as we work with Laravel teams.
I have seen a repeated pattern where test methods are using snake_case despite the rest of the codebase using camelCase. And this isn't a new phenomenon with the introduction of Pest.
Here are some of my arguments for why we use camelCase for test methods in our projects.
First, consistency! This is huge. Having to juggle two code styles in different places of the project just doesn't make sense to me.
Second, a common counter-argument I hear is that "I like the test output better with snake_case".
I don't understand wanting to see test names flying by when I run my tests. (And now those are chewing up precious LLM context tokens too.) But even if you did like that, PHPUnit (and Pest) render both camelCase and snake_case test method names the same way in the output.
Finally, I've heard the argument that snake_case is easier to scan in the test classes. I place an extremely high value on test scan-ability, but I think there are more important factors than the method casing.
I know coding standards are subjective, and this is probably a debate that will never be resolved, but I wanted to share my perspective.
And if you have snake_case test methods in a robust test suite, I would take that every day over an empty test suite.
Here to help,
Joel
P.S. Want to explain to me why I'm wrong about this? Join one of our community dev calls.