Skip to content

Commit 6051a1e

Browse files
committed
Fix tests
1 parent b569102 commit 6051a1e

File tree

3 files changed

+381
-4
lines changed

3 files changed

+381
-4
lines changed

src/CodeCoverage.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ public function merge(PHP_CodeCoverage $that)
350350
foreach ($that->getData() as $file => $fileData) {
351351
if (!isset($this->data[$file])) {
352352
if (!$that->filter()->isFiltered($file)) {
353-
$this->data[$file] = ['lines' => $fileData['lines']];
353+
$this->data[$file] = $fileData;
354354
}
355355

356356
continue;
@@ -500,7 +500,10 @@ private function applyCoversAnnotationFilter(array &$data, $linesToBeCovered, ar
500500
{
501501
if ($linesToBeCovered === false ||
502502
($this->forceCoversAnnotation && empty($linesToBeCovered))) {
503-
$data = ['lines' => []];
503+
$data = [
504+
'lines' => [],
505+
'functions' => [],
506+
];
504507

505508
return;
506509
}
@@ -626,7 +629,10 @@ private function addUncoveredFilesFromWhitelist()
626629
$uncoveredFiles
627630
);
628631
} else {
629-
$data[$uncoveredFile] = ['lines' => []];
632+
$data[$uncoveredFile] = [
633+
'lines' => [],
634+
'functions' => [],
635+
];
630636

631637
$lines = count(file($uncoveredFile));
632638

@@ -659,7 +665,7 @@ private function processUncoveredFileFromWhitelist($uncoveredFile, array &$data,
659665
}
660666
}
661667

662-
$data[$file] = ['lines' => $fileCoverage];
668+
$data[$file] = $fileCoverage;
663669
}
664670
}
665671
}

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)