Skip to content

Commit c3aab3c

Browse files
committed
Fix some of the coverage issues
1 parent 6f53e9b commit c3aab3c

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/CodeCoverage.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,10 @@ private function initializeFilesThatAreSeenTheFirstTime(array $data): void
619619
foreach ($fileData['lines'] as $lineNumber => $flag) {
620620
if ($flag === Driver::LINE_NOT_EXECUTABLE) {
621621
$this->data[$file]['lines'][$lineNumber] = null;
622+
} else {
623+
$this->addCoverageLinePathCovered($file, $lineNumber, false);
622624
}
625+
623626
}
624627

625628
foreach ($fileData['functions'] as $functionName => $functionData) {
@@ -1190,9 +1193,9 @@ private function initializeData(): void
11901193
continue;
11911194
}
11921195

1193-
foreach (\array_keys($fileCoverage) as $key) {
1194-
if ($fileCoverage[$key] === Driver::LINE_EXECUTED) {
1195-
$fileCoverage[$key] = Driver::LINE_NOT_EXECUTED;
1196+
foreach (\array_keys($fileCoverage['lines']) as $key) {
1197+
if ($fileCoverage['lines'][$key] === Driver::LINE_EXECUTED) {
1198+
$fileCoverage['lines'][$key] = Driver::LINE_NOT_EXECUTED;
11961199
}
11971200
}
11981201

src/Driver/Xdebug.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function start(bool $determineUnusedAndDead = true): void
5454
}
5555

5656
if ($this->determineBranchCoverage) {
57-
$flag = XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE | XDEBUG_CC_BRANCH_CHECK;
57+
$flag |= XDEBUG_CC_BRANCH_CHECK;
5858
}
5959

6060
\xdebug_start_code_coverage($flag);

0 commit comments

Comments
 (0)