rspec/rules/S3360/php/rule.adoc

41 lines
840 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
2022-02-04 17:28:24 +01:00
[source,php]
----
class TestClassX extends PHPUnit\Framework\TestCase { // Noncompliant
public void testDoTheThing() {
//...
----
== Compliant Solution
2022-02-04 17:28:24 +01:00
[source,php]
----
class ClassXTest extends PHPUnit\Framework\TestCase {
public void testDoTheThing() {
//...
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::../highlighting.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]