Skip to content

Commit

Permalink
Fix coverage when no assertion is expected (#355)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Jul 7, 2022
1 parent 8ed793d commit d3520ef
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Phpunit/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ protected function tearDown(): void
gc_collect_cycles();
}
gc_collect_cycles();

// fix coverage when no assertion is expected
// https://github.com/sebastianbergmann/phpunit/pull/5010
if ($this->getNumAssertions() === 0 && $this->doesNotPerformAssertions()) {
$this->getTestResultObject()->beStrictAboutTestsThatDoNotTestAnything(false);
}
}

/**
Expand Down

0 comments on commit d3520ef

Please sign in to comment.