Skip to content

Commit

Permalink
CodeCoverage: process PHP report as first in list to avoid serializin…
Browse files Browse the repository at this point in the history
…g cache data
  • Loading branch information
Slamdunk authored and sebastianbergmann committed Sep 12, 2023
1 parent 63d1346 commit a3ad9d1
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/TextUI/TestRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,21 @@ public function run(TestSuite $suite, array $arguments = [], array $warnings = [
$this->printer->printResult($result);

if (isset($codeCoverage)) {
if (isset($arguments['coveragePHP'])) {
$this->codeCoverageGenerationStart('PHP');

try {
$writer = new PhpReport;
$writer->process($codeCoverage, $arguments['coveragePHP']);

$this->codeCoverageGenerationSucceeded();

unset($writer);
} catch (CodeCoverageException $e) {
$this->codeCoverageGenerationFailed($e);
}
}

if (isset($arguments['coverageClover'])) {
$this->codeCoverageGenerationStart('Clover XML');

Expand Down Expand Up @@ -728,21 +743,6 @@ public function run(TestSuite $suite, array $arguments = [], array $warnings = [
}
}

if (isset($arguments['coveragePHP'])) {
$this->codeCoverageGenerationStart('PHP');

try {
$writer = new PhpReport;
$writer->process($codeCoverage, $arguments['coveragePHP']);

$this->codeCoverageGenerationSucceeded();

unset($writer);
} catch (CodeCoverageException $e) {
$this->codeCoverageGenerationFailed($e);
}
}

if (isset($arguments['coverageText'])) {
if ($arguments['coverageText'] === 'php://stdout') {
$outputStream = $this->printer;
Expand Down

0 comments on commit a3ad9d1

Please sign in to comment.