Skip to content

Commit

Permalink
Write to coverage text file if requested
Browse files Browse the repository at this point in the history
  • Loading branch information
datashaman committed Apr 15, 2019
1 parent 83e73eb commit c69af19
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Reporters/TextCoverageReporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ public function onEnd(Events\EndEvent $event): void
public function onEndAll(Events\EndAllEvent $event): void
{
$writer = new Text();


if ($this->input->getOption('coverage-text')) {
$output = $writer->process($this->coverage, false);
file_put_contents($this->input->getOption('coverage-text'), $output);

return;
}

print $writer->process($this->coverage, true);
}

Expand Down

0 comments on commit c69af19

Please sign in to comment.