rspec/rules/S3360/php/rule.adoc

22 lines
523 B
Plaintext
Raw Normal View History

By default, PHPUnit CLI only executes test classes with names that end in "Test". Name your class "TestClassX.php", for instance, and it will be skipped.
2021-02-02 15:02:10 +01:00
This rule raises an issue for each test class with a name not ending in "Test".
== Noncompliant Code Example
----
class TestClassX extends PHPUnit\Framework\TestCase { // Noncompliant
public void testDoTheThing() {
//...
----
== Compliant Solution
----
class ClassXTest extends PHPUnit\Framework\TestCase {
public void testDoTheThing() {
//...
----