Skip to content

Commit 3f2a451

Browse files
committed
Feat: Add PhpUnitFqcnAnnotationFixer
1 parent 1f5454b commit 3f2a451

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

Diff for: ecs.php

+3
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
use PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer;
133133
use PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertInternalTypeFixer;
134134
use PhpCsFixer\Fixer\PhpUnit\PhpUnitExpectationFixer;
135+
use PhpCsFixer\Fixer\PhpUnit\PhpUnitFqcnAnnotationFixer;
135136
use PhpCsFixer\Fixer\PhpUnit\PhpUnitMockFixer;
136137
use PhpCsFixer\Fixer\PhpUnit\PhpUnitMockShortWillReturnFixer;
137138
use PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer;
@@ -390,6 +391,8 @@
390391
PhpUnitNoExpectationAnnotationFixer::class,
391392
// Usages of ->setExpectedException* methods MUST be replaced by ->expectException* methods
392393
PhpUnitExpectationFixer::class,
394+
// PHPUnit annotations should be a FQCNs including a root namespace.
395+
PhpUnitFqcnAnnotationFixer::class,
393396
// Visibility of setUp() and tearDown() method should be kept protected
394397
PhpUnitSetUpTearDownVisibilityFixer::class,
395398
// There should not be an empty `return` statement at the end of a function

Diff for: tests/Integration/Fixtures/PhpUnit.correct.php.inc

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ namespace Lmc\CodingStandard\Integration\Fixtures;
44

55
use PHPUnit\Framework\TestCase;
66

7+
/**
8+
* @covers \Lmc\CodingStandard\Integration\Fixtures\MyClass
9+
*/
710
class PhpUnit extends TestCase
811
{
912
// PhpUnitSetUpTearDownVisibilityFixer

Diff for: tests/Integration/Fixtures/PhpUnit.wrong.php.inc

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ namespace Lmc\CodingStandard\Integration\Fixtures;
44

55
use PHPUnit\Framework\TestCase;
66

7+
/**
8+
* @covers Lmc\CodingStandard\Integration\Fixtures\MyClass
9+
*/
710
class PhpUnit extends TestCase
811
{
912
// PhpUnitSetUpTearDownVisibilityFixer

0 commit comments

Comments
 (0)