
When an include is not surrounded by empty lines, its content is inlined on the same line as the adjacent content. That can lead to broken tags and other display issues. This PR fixes all such includes and introduces a validation step that forbids introducing the same problem again.
59 lines
1.4 KiB
Plaintext
59 lines
1.4 KiB
Plaintext
== Why is this an issue?
|
|
|
|
When a test fails due, for example, to infrastructure issues, you might want to ignore it temporarily. But without some kind of notation about why the test is being ignored, it may never be reactivated. Such tests are difficult to address without comprehensive knowledge of the project, and end up polluting their projects.
|
|
|
|
|
|
This rule raises an issue on each test that is marked as incomplete or skipped without a message explaining the reasoning behind it.
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,php]
|
|
----
|
|
protected function setUp() {
|
|
if (!extension_loaded('mysqli')) {
|
|
$this->markTestSkipped(); // Noncompliant
|
|
}
|
|
}
|
|
|
|
public function testSomething()
|
|
{
|
|
$this->assertTrue($result->isValid());
|
|
$this->markTestIncomplete(); // Noncompliant
|
|
}
|
|
----
|
|
|
|
=== Compliant solution
|
|
|
|
[source,php]
|
|
----
|
|
protected function setUp() {
|
|
if (!extension_loaded('mysqli')) {
|
|
$this->markTestSkipped( 'The MySQLi extension is not available.' ); // Compliant
|
|
}
|
|
}
|
|
|
|
public function testSomething()
|
|
{
|
|
$this->assertTrue($result->isValid());
|
|
$this->markTestIncomplete( 'Testing result validation is incomplete.' ); // Compliant
|
|
}
|
|
----
|
|
|
|
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[]
|