Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8e7c0c9

Browse files
committed
Feat: Add PhpUnitMethodCasingFixer
1 parent 9dc9a8d commit 8e7c0c9

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

‎ecs.php‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@
133133
use PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertInternalTypeFixer;
134134
use PhpCsFixer\Fixer\PhpUnit\PhpUnitExpectationFixer;
135135
use PhpCsFixer\Fixer\PhpUnit\PhpUnitFqcnAnnotationFixer;
136+
use PhpCsFixer\Fixer\PhpUnit\PhpUnitMethodCasingFixer;
136137
use PhpCsFixer\Fixer\PhpUnit\PhpUnitMockFixer;
137138
use PhpCsFixer\Fixer\PhpUnit\PhpUnitMockShortWillReturnFixer;
138139
use PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer;
@@ -535,6 +536,8 @@
535536
->withConfiguredRule(PhpdocOrderFixer::class, ['order' => ['param', 'return', 'throws']])
536537
// Order phpdoc tags by value.
537538
->withConfiguredRule(PhpdocOrderByValueFixer::class, ['annotations' => ['covers', 'group', 'throws']])
539+
// Enforce camel case for PHPUnit test methods.
540+
->withConfiguredRule(PhpUnitMethodCasingFixer::class, ['case' => 'camel_case'])
538541
// Calls to `PHPUnit\Framework\TestCase` static methods must all be of the same type (`$this->...`)
539542
->withConfiguredRule(PhpUnitTestCaseStaticMethodCallsFixer::class, ['call_type' => 'this'])
540543
// An empty line feed must precede any configured statement

‎tests/Integration/Fixtures/PhpUnit.correct.php.inc‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,9 @@ class PhpUnit extends TestCase
3131
// PhpUnitTestCaseStaticMethodCallsFixer
3232
$this->assertSame(1, 2);
3333
}
34+
35+
public function testMethodName(): void // PhpUnitMethodCasingFixer
36+
{
37+
$this->assertTrue(true);
38+
}
3439
}

‎tests/Integration/Fixtures/PhpUnit.wrong.php.inc‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,9 @@ class PhpUnit extends TestCase
3131
// PhpUnitTestCaseStaticMethodCallsFixer
3232
static::assertSame(1, 2);
3333
}
34+
35+
public function test_method_name(): void // PhpUnitMethodCasingFixer
36+
{
37+
$this->assertTrue(true);
38+
}
3439
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /