function PhptTestCase::cleanupForCoverage
1 call to PhptTestCase::cleanupForCoverage()
- PhptTestCase::run in vendor/
phpunit/ phpunit/ src/ Runner/ PhptTestCase.php - Runs a test and collects its result in a TestResult instance.
File
-
vendor/
phpunit/ phpunit/ src/ Runner/ PhptTestCase.php, line 650
Class
- PhptTestCase
- @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
Namespace
PHPUnit\RunnerCode
private function cleanupForCoverage() : RawCodeCoverageData {
$coverage = RawCodeCoverageData::fromXdebugWithoutPathCoverage([]);
$files = $this->getCoverageFiles();
$buffer = false;
if (is_file($files['coverage'])) {
$buffer = @file_get_contents($files['coverage']);
}
if ($buffer !== false) {
$coverage = @unserialize($buffer);
if ($coverage === false) {
$coverage = RawCodeCoverageData::fromXdebugWithoutPathCoverage([]);
}
}
foreach ($files as $file) {
@unlink($file);
}
return $coverage;
}