Skip to content

Commit d169164

Browse files
committed
Fix tests
1 parent 800227d commit d169164

File tree

3 files changed

+377
-3
lines changed

3 files changed

+377
-3
lines changed

src/CodeCoverage.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ public function merge(PHP_CodeCoverage $that)
355355
foreach ($that->getData() as $file => $fileData) {
356356
if (!isset($this->data[$file])) {
357357
if (!$that->filter()->isFiltered($file)) {
358-
$this->data[$file] = ['lines' => $fileData['lines']];
358+
$this->data[$file] = $fileData;
359359
}
360360

361361
continue;
@@ -638,7 +638,10 @@ private function addUncoveredFilesFromWhitelist()
638638
$uncoveredFiles
639639
);
640640
} else {
641-
$data[$uncoveredFile] = ['lines' => []];
641+
$data[$uncoveredFile] = [
642+
'lines' => [],
643+
'functions' => [],
644+
];
642645

643646
$lines = count(file($uncoveredFile));
644647

@@ -671,7 +674,7 @@ private function processUncoveredFileFromWhitelist($uncoveredFile, array &$data,
671674
}
672675
}
673676

674-
$data[$file] = ['lines' => $fileCoverage];
677+
$data[$file] = $fileCoverage;
675678
}
676679
}
677680
}

src/CodeCoverage/Driver/Xdebug.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ private function cleanup(array $data)
7878
if (!isset($data[$file]['lines'])) {
7979
$data[$file] = ['lines' => $data[$file]];
8080
}
81+
if (!isset($data[$file]['functions'])) {
82+
$data[$file]['functions'] = [];
83+
}
8184

8285
unset($data[$file]['lines'][0]);
8386

0 commit comments

Comments
 (0)