From a7a43f8c3d07fa74114c18616687c178b928f124 Mon Sep 17 00:00:00 2001 From: "Thomas A. Hirsch" Date: Sat, 11 Sep 2021 19:08:58 +0200 Subject: [PATCH] Fixed addTestSuites-Call in case the name attribute is empty and there is only one testsuite within the testsuite. --- src/PhpunitMerger/Command/LogCommand.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PhpunitMerger/Command/LogCommand.php b/src/PhpunitMerger/Command/LogCommand.php index d30e6ef..5024607 100644 --- a/src/PhpunitMerger/Command/LogCommand.php +++ b/src/PhpunitMerger/Command/LogCommand.php @@ -82,7 +82,8 @@ private function addTestSuites(\DOMElement $parent, array $testSuites) foreach ($testSuites as $testSuite) { if (empty($testSuite['@attributes']['name'])) { if (!empty($testSuite['testsuite'])) { - $this->addTestSuites($parent, $testSuite['testsuite']); + $children = isset($testSuite['testsuite']['@attributes']) ? [$testSuite['testsuite']] : $testSuite['testsuite']; + $this->addTestSuites($parent, $children); } continue; }