diff --git a/src/PhpParser/Visitor/IgnoreNode/PhpUnitCodeCoverageAnnotationIgnorer.php b/src/PhpParser/Visitor/IgnoreNode/PhpUnitCodeCoverageAnnotationIgnorer.php deleted file mode 100644 index 85d0978cc..000000000 --- a/src/PhpParser/Visitor/IgnoreNode/PhpUnitCodeCoverageAnnotationIgnorer.php +++ /dev/null @@ -1,59 +0,0 @@ -getDocComment(); - - return $docComment !== null - && strpos($docComment->getText(), '@codeCoverageIgnore') !== false - ; - } -} diff --git a/src/TestFramework/PhpUnit/Adapter/PhpUnitAdapter.php b/src/TestFramework/PhpUnit/Adapter/PhpUnitAdapter.php index 13b6cc69f..03326c597 100644 --- a/src/TestFramework/PhpUnit/Adapter/PhpUnitAdapter.php +++ b/src/TestFramework/PhpUnit/Adapter/PhpUnitAdapter.php @@ -38,13 +38,11 @@ use function escapeshellarg; use Infection\AbstractTestFramework\MemoryUsageAware; use Infection\Config\ValueProvider\PCOVDirectoryProvider; -use Infection\PhpParser\Visitor\IgnoreNode\PhpUnitCodeCoverageAnnotationIgnorer; use Infection\TestFramework\AbstractTestFrameworkAdapter; use Infection\TestFramework\CommandLineArgumentsAndOptionsBuilder; use Infection\TestFramework\CommandLineBuilder; use Infection\TestFramework\Config\InitialConfigBuilder; use Infection\TestFramework\Config\MutationConfigBuilder; -use Infection\TestFramework\IgnoresAdditionalNodes; use Infection\TestFramework\ProvidesInitialRunOnlyOptions; use Infection\TestFramework\VersionParser; use function Safe\preg_match; @@ -56,7 +54,7 @@ * @internal * @final */ -class PhpUnitAdapter extends AbstractTestFrameworkAdapter implements IgnoresAdditionalNodes, MemoryUsageAware, ProvidesInitialRunOnlyOptions +class PhpUnitAdapter extends AbstractTestFrameworkAdapter implements MemoryUsageAware, ProvidesInitialRunOnlyOptions { public const COVERAGE_DIR = 'coverage-xml'; @@ -172,11 +170,6 @@ public function getInitialTestsFailRecommendations(string $commandLine): string return $recommendations; } - public function getNodeIgnorers(): array - { - return [new PhpUnitCodeCoverageAnnotationIgnorer()]; - } - /** * @return string[] */ diff --git a/tests/e2e/Ignore_All_Mutations/src/DoNotMutateClass.php b/tests/e2e/Ignore_All_Mutations/src/DoNotMutateClass.php new file mode 100644 index 000000000..917716edb --- /dev/null +++ b/tests/e2e/Ignore_All_Mutations/src/DoNotMutateClass.php @@ -0,0 +1,12 @@ +assertGreaterThan(0.0, $sourceClass->divide(2, 2)); + } + +} diff --git a/tests/phpunit/PhpParser/Visitor/IgnoreNode/PhpUnitCodeCoverageAnnotationIgnorerTest.php b/tests/phpunit/PhpParser/Visitor/IgnoreNode/PhpUnitCodeCoverageAnnotationIgnorerTest.php deleted file mode 100644 index cb7c66c2d..000000000 --- a/tests/phpunit/PhpParser/Visitor/IgnoreNode/PhpUnitCodeCoverageAnnotationIgnorerTest.php +++ /dev/null @@ -1,161 +0,0 @@ -createSpy(); - - $this->parseAndTraverse($code, $spy); - - $this->assertSame($count, $spy->nodeCounter); - } - - public function provideIgnoreCases(): iterable - { - yield 'classes with annotation are ignored' => [ - <<<'PHP' - [ - <<<'PHP' - [ - <<<'PHP' - [ - <<<'PHP' - [ - <<<'PHP' -adapter->getNodeIgnorers()); - - $this->assertSame( - [PhpUnitCodeCoverageAnnotationIgnorer::class], - $nodeIgnorers - ); - } - /** * @group integration */