|
@@ -229,7 +229,7 @@ final class ProjectCodeTest extends TestCase
|
|
|
);
|
|
|
|
|
|
if ([] === $publicMethods) {
|
|
|
- $this->addToAssertionCount(1); // no methods to test, all good!
|
|
|
+ $this->expectNotToPerformAssertions(); // no methods to test, all good!
|
|
|
|
|
|
return;
|
|
|
}
|
|
@@ -261,7 +261,7 @@ final class ProjectCodeTest extends TestCase
|
|
|
}
|
|
|
|
|
|
if (0 === $asserts) {
|
|
|
- $this->addToAssertionCount(1); // no data providers to test, all good!
|
|
|
+ $this->expectNotToPerformAssertions(); // no data providers to test, all good!
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -281,7 +281,7 @@ final class ProjectCodeTest extends TestCase
|
|
|
);
|
|
|
|
|
|
if ([] === $definedDataProviders) {
|
|
|
- $this->addToAssertionCount(1); // no methods to test, all good!
|
|
|
+ $this->expectNotToPerformAssertions(); // no methods to test, all good!
|
|
|
|
|
|
return;
|
|
|
}
|
|
@@ -309,7 +309,7 @@ final class ProjectCodeTest extends TestCase
|
|
|
$reflectionClass = new \ReflectionClass($testClassName);
|
|
|
|
|
|
if ($reflectionClass->isAbstract() || $reflectionClass->isInterface()) {
|
|
|
- $this->addToAssertionCount(1);
|
|
|
+ $this->expectNotToPerformAssertions();
|
|
|
|
|
|
return;
|
|
|
}
|
|
@@ -318,7 +318,7 @@ final class ProjectCodeTest extends TestCase
|
|
|
static::assertNotFalse($doc);
|
|
|
|
|
|
if (1 === Preg::match('/@coversNothing/', $doc, $matches)) {
|
|
|
- $this->addToAssertionCount(1);
|
|
|
+ $this->expectNotToPerformAssertions();
|
|
|
|
|
|
return;
|
|
|
}
|
|
@@ -332,13 +332,10 @@ final class ProjectCodeTest extends TestCase
|
|
|
$parentClassName = false === $parentClass ? null : '\\'.$parentClass->getName();
|
|
|
|
|
|
foreach ($matches as $match) {
|
|
|
- if ($match === $class || $parentClassName === $match) {
|
|
|
- $this->addToAssertionCount(1);
|
|
|
-
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
- static::fail(sprintf('Unexpected @covers "%s" for "%s".', $match, $testClassName));
|
|
|
+ static::assertTrue(
|
|
|
+ $match === $class || $parentClassName === $match,
|
|
|
+ sprintf('Unexpected @covers "%s" for "%s".', $match, $testClassName)
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -389,7 +386,7 @@ final class ProjectCodeTest extends TestCase
|
|
|
);
|
|
|
|
|
|
if ([] === $publicMethods) {
|
|
|
- $this->addToAssertionCount(1); // no methods to test, all good!
|
|
|
+ $this->expectNotToPerformAssertions(); // no methods to test, all good!
|
|
|
|
|
|
return;
|
|
|
}
|
|
@@ -493,7 +490,7 @@ final class ProjectCodeTest extends TestCase
|
|
|
public function testThereIsNoTriggerErrorUsedDirectly(string $className): void
|
|
|
{
|
|
|
if (Utils::class === $className) {
|
|
|
- $this->addToAssertionCount(1); // This is where "trigger_error" should be
|
|
|
+ $this->expectNotToPerformAssertions(); // This is where "trigger_error" should be
|
|
|
|
|
|
return;
|
|
|
}
|
|
@@ -710,7 +707,7 @@ final class ProjectCodeTest extends TestCase
|
|
|
$reflectionClassConstants = $rc->getReflectionConstants();
|
|
|
|
|
|
if (\count($reflectionClassConstants) < 1) {
|
|
|
- $this->addToAssertionCount(1);
|
|
|
+ $this->expectNotToPerformAssertions();
|
|
|
|
|
|
return;
|
|
|
}
|