Skip to content

Commit 4a4c65c

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 d0ba7c6 commit 4a4c65c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)