diff --git a/src/Console/Application.php b/src/Console/Application.php index 5059e86102..6f1d3ec17a 100644 --- a/src/Console/Application.php +++ b/src/Console/Application.php @@ -188,6 +188,8 @@ private function logRunningWithDebugger(): void $this->consoleOutput->logRunningWithDebugger(\PHP_SAPI); } elseif (\extension_loaded('xdebug')) { $this->consoleOutput->logRunningWithDebugger('Xdebug'); + } elseif (\extension_loaded('pcov')) { + $this->consoleOutput->logRunningWithDebugger('PCOV'); } } } diff --git a/src/Process/Coverage/CoverageRequirementChecker.php b/src/Process/Coverage/CoverageRequirementChecker.php index 8f0e212878..5eb6978cb4 100644 --- a/src/Process/Coverage/CoverageRequirementChecker.php +++ b/src/Process/Coverage/CoverageRequirementChecker.php @@ -63,6 +63,7 @@ public function hasDebuggerOrCoverageOption(): bool return $this->skipCoverage || \PHP_SAPI === 'phpdbg' || \extension_loaded('xdebug') + || \extension_loaded('pcov') || XdebugHandler::getSkippedVersion() || $this->isXdebugIncludedInInitialTestPhpOptions(); } diff --git a/tests/Fixtures/e2e/PCOV_PHPUnit8/README.md b/tests/Fixtures/e2e/PCOV_PHPUnit8/README.md new file mode 100644 index 0000000000..baf513e332 --- /dev/null +++ b/tests/Fixtures/e2e/PCOV_PHPUnit8/README.md @@ -0,0 +1,9 @@ +# Title + +* Link to github ticket if relevant + +## Summary +Short summary of the ticket + +## Full Ticket +Full github ticket \ No newline at end of file diff --git a/tests/Fixtures/e2e/PCOV_PHPUnit8/composer.json b/tests/Fixtures/e2e/PCOV_PHPUnit8/composer.json new file mode 100644 index 0000000000..b19c83a95f --- /dev/null +++ b/tests/Fixtures/e2e/PCOV_PHPUnit8/composer.json @@ -0,0 +1,15 @@ +{ + "require-dev": { + "phpunit/phpunit": "^8" + }, + "autoload": { + "psr-4": { + "PCOV_PHPUnit8\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "PCOV_PHPUnit8\\Test\\": "tests/" + } + } +} diff --git a/tests/Fixtures/e2e/PCOV_PHPUnit8/expected-output.txt b/tests/Fixtures/e2e/PCOV_PHPUnit8/expected-output.txt new file mode 100644 index 0000000000..99606b97d5 --- /dev/null +++ b/tests/Fixtures/e2e/PCOV_PHPUnit8/expected-output.txt @@ -0,0 +1,6 @@ +Total: 1 +Killed: 1 +Errored: 0 +Escaped: 0 +Timed Out: 0 +Not Covered: 0 \ No newline at end of file diff --git a/tests/Fixtures/e2e/PCOV_PHPUnit8/infection.json b/tests/Fixtures/e2e/PCOV_PHPUnit8/infection.json new file mode 100644 index 0000000000..7029746fb6 --- /dev/null +++ b/tests/Fixtures/e2e/PCOV_PHPUnit8/infection.json @@ -0,0 +1,12 @@ +{ + "timeout": 25, + "source": { + "directories": [ + "src" + ] + }, + "logs": { + "summary": "infection.log" + }, + "tmpDir": "." +} diff --git a/tests/Fixtures/e2e/PCOV_PHPUnit8/phpunit.xml.dist b/tests/Fixtures/e2e/PCOV_PHPUnit8/phpunit.xml.dist new file mode 100644 index 0000000000..9a836774d9 --- /dev/null +++ b/tests/Fixtures/e2e/PCOV_PHPUnit8/phpunit.xml.dist @@ -0,0 +1,18 @@ + + + + + ./tests/ + + + + + + ./src/ + + + diff --git a/tests/Fixtures/e2e/PCOV_PHPUnit8/src/SourceClass.php b/tests/Fixtures/e2e/PCOV_PHPUnit8/src/SourceClass.php new file mode 100644 index 0000000000..24dbe38d9d --- /dev/null +++ b/tests/Fixtures/e2e/PCOV_PHPUnit8/src/SourceClass.php @@ -0,0 +1,11 @@ +assertSame('hello', $sourceClass->hello()); + } +}