Skip to content

Commit

Permalink
Combining junit files drops the file name
Browse files Browse the repository at this point in the history
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';
  • Loading branch information
gnat42 authored Aug 4, 2022
1 parent 4009f19 commit d46c208
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PhpunitMerger/Command/LogCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ private function addTestSuites(\DOMElement $parent, array $testSuites)
$element->setAttribute('parent', $parent->getAttribute('name'));
$attributes = $testSuite['@attributes'] ?? [];
foreach ($attributes as $key => $value) {
$value = $key === 'name' ? $value : 0;
$value = $key === 'name' || $key === 'file' ? $value : 0;
$element->setAttribute($key, (string)$value);
}
$parent->appendChild($element);
Expand Down

0 comments on commit d46c208

Please sign in to comment.