Skip to content

[CodeQuality] Rule to enforce test method code style#668

Open
Xammie wants to merge 2 commits intorectorphp:mainfrom
Xammie:add-test-case-style-rules
Open

[CodeQuality] Rule to enforce test method code style#668
Xammie wants to merge 2 commits intorectorphp:mainfrom
Xammie:add-test-case-style-rules

Conversation

@Xammie
Copy link
Copy Markdown

@Xammie Xammie commented Apr 3, 2026

This adds two rules to convert the name of test methods to either CamelCase or snake_case.

// When using
use Rector\PHPUnit\CodeQuality\Rector\ClassMethod\PreferTestsWithSnakeCaseRector
$rectorConfig->rule(PreferTestsWithSnakeCaseRector::class);

// From
public function testItWillCreateNewProduct() {}
// To
public function test_it_will_create_new_product() {}

@Xammie Xammie changed the title [CodeQuality] Rule to enfore test method style [CodeQuality] Rule to enfore test method code style Apr 3, 2026
@Xammie Xammie changed the title [CodeQuality] Rule to enfore test method code style [CodeQuality] Rule to enforce test method code style Apr 3, 2026
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.

1 participant