Closed
Description
Generally speaking PHPUnit looks for tests in files named *Test.php
, which conventionally means the classes should be named *Test
. Additionally I believe it is recommended/required (I cannot find docs for this) that "tests" designed to be extended should be named *TestCase
.
I propose adding rule to this extension which enforces that classes are named appropriately:
- If a concrete class extends
PHPUnit\Framework\TestCase
and it should be named*Test
- could also enforcefinal
? - If an abstract class extends
PHPUnit\Framework\TestCase
it should be named*TestCase
.
Ideally the rule would also enforce the file is named appropriately as well but that might be outside scope.
If this convention isn't followed and you don't explicitly tell PHPUnit your test files then tests are not run, potentially keeping the build passing because a number of tests are being silently ignored.
Metadata
Metadata
Assignees
Labels
No labels