Skip to content

Commit

Permalink
CliTester: hint message when coverage file is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
milo committed Jul 20, 2018
1 parent a3a8569 commit a65fa39
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Runner/CliTester.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ private function finishCodeCoverage(string $file): void
if (!in_array($this->options['-o'], ['none', 'tap', 'junit'], true)) {
echo 'Generating code coverage report... ';
}
if (filesize($file) === 0) {
echo 'failed. Coverage file is empty. Do you call Tester\Environment::setup() in tests?';
return;
}
if (pathinfo($file, PATHINFO_EXTENSION) === 'xml') {
$generator = new CodeCoverage\Generators\CloverXMLGenerator($file, $this->options['--coverage-src']);
} else {
Expand Down

0 comments on commit a65fa39

Please sign in to comment.