Skip to content

Commit 98648bd

Browse files
committed
Combining junit files drops the file name
We were combining two junit files produced by phpunit, but the combined file loses the file name attribute. Then later when we processed with the phpmetrics project, it complained it couldn't find the file named '0';
1 parent 87d4f86 commit 98648bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PhpunitMerger/Command/LogCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ private function addTestSuites(\DOMElement $parent, array $testSuites)
9595
$element->setAttribute('parent', $parent->getAttribute('name'));
9696
$attributes = $testSuite['@attributes'] ?? [];
9797
foreach ($attributes as $key => $value) {
98-
$value = $key === 'name' ? $value : 0;
98+
$value = $key === 'name' || $key === 'file' ? $value : 0;
9999
$element->setAttribute($key, (string)$value);
100100
}
101101
$parent->appendChild($element);

0 commit comments

Comments
 (0)