Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove CodeCoverageAnnotationIgnorer #1517

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view

This file was deleted.

9 changes: 1 addition & 8 deletions src/TestFramework/PhpUnit/Adapter/PhpUnitAdapter.php
Expand Up @@ -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;
Expand All @@ -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';

Expand Down Expand Up @@ -172,11 +170,6 @@ public function getInitialTestsFailRecommendations(string $commandLine): string
return $recommendations;
}

public function getNodeIgnorers(): array
{
return [new PhpUnitCodeCoverageAnnotationIgnorer()];
}

/**
* @return string[]
*/
Expand Down
12 changes: 12 additions & 0 deletions tests/e2e/Ignore_All_Mutations/src/DoNotMutateClass.php
@@ -0,0 +1,12 @@
<?php

namespace Ignore_All_Mutations;

/** @infection-ignore-all */
class DoNotMutateClass
{
public function divide(int $a, int $b): float
{
return $a / $b;
}
}
16 changes: 16 additions & 0 deletions tests/e2e/Ignore_All_Mutations/tests/DoNotMutateClassTest.php
@@ -0,0 +1,16 @@
<?php

namespace Ignore_All_Mutations\Test;

use Ignore_All_Mutations\DoNotMutateClass;
use PHPUnit\Framework\TestCase;

class DoNotMutateClassTest extends TestCase
{
public function test_divide()
{
$sourceClass = new DoNotMutateClass();
$this->assertGreaterThan(0.0, $sourceClass->divide(2, 2));
}

}

This file was deleted.

12 changes: 0 additions & 12 deletions tests/phpunit/TestFramework/PhpUnit/Adapter/PhpUnitAdapterTest.php
Expand Up @@ -35,10 +35,8 @@

namespace Infection\Tests\TestFramework\PhpUnit\Adapter;

use function array_map;
use const DIRECTORY_SEPARATOR;
use Infection\Config\ValueProvider\PCOVDirectoryProvider;
use Infection\PhpParser\Visitor\IgnoreNode\PhpUnitCodeCoverageAnnotationIgnorer;
use Infection\TestFramework\CommandLineArgumentsAndOptionsBuilder;
use Infection\TestFramework\CommandLineBuilder;
use Infection\TestFramework\PhpUnit\Adapter\PhpUnitAdapter;
Expand Down Expand Up @@ -124,16 +122,6 @@ public function test_it_provides_initial_run_only_options(): void
);
}

public function test_it_provides_node_ignorers(): void
{
$nodeIgnorers = array_map('get_class', $this->adapter->getNodeIgnorers());

$this->assertSame(
[PhpUnitCodeCoverageAnnotationIgnorer::class],
$nodeIgnorers
);
}

/**
* @group integration
*/
Expand Down