function ProcessedCodeCoverageData::markCodeAsExecutedByTestCase
File
-
vendor/
phpunit/ php-code-coverage/ src/ Data/ ProcessedCodeCoverageData.php, line 85
Class
- ProcessedCodeCoverageData
- @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
Namespace
SebastianBergmann\CodeCoverage\DataCode
public function markCodeAsExecutedByTestCase(string $testCaseId, RawCodeCoverageData $executedCode) : void {
foreach ($executedCode->lineCoverage() as $file => $lines) {
foreach ($lines as $k => $v) {
if ($v === Driver::LINE_EXECUTED) {
$this->lineCoverage[$file][$k][] = $testCaseId;
}
}
}
foreach ($executedCode->functionCoverage() as $file => $functions) {
foreach ($functions as $functionName => $functionData) {
foreach ($functionData['branches'] as $branchId => $branchData) {
if ($branchData['hit'] === Driver::BRANCH_HIT) {
$this->functionCoverage[$file][$functionName]['branches'][$branchId]['hit'][] = $testCaseId;
}
}
foreach ($functionData['paths'] as $pathId => $pathData) {
if ($pathData['hit'] === Driver::BRANCH_HIT) {
$this->functionCoverage[$file][$functionName]['paths'][$pathId]['hit'][] = $testCaseId;
}
}
}
}
}