-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
enhancementNew feature or requestNew feature or request
Description
If we use @test
annotations to declare test methods, you may forgot to add the annotation, leading to the test method being silently ignored and not executed.
public function shouldDoSomething(): void
{
// ...
}
We could make fixer to make sure public method starting with "should" (which is our convention for test method names) have the @test
annotation. (This must apply only to PHPUnit test files, ie. files having "Test.php" suffix).
Also make sure we cover case when @test
annotation is wrongly declared (missing space - /**@test */)
and thus undetected by PHPUnit as test method.
Note - there is PhpCsFixer\Fixer\PhpUnit\PhpUnitTestAnnotationFixer, but it does only unifies the style, even with style set to "annotations", it won't detect methods missing the annotation.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request