diff --git a/src/ChangesReporting/Output/JUnitOutputFormatter.php b/src/ChangesReporting/Output/JUnitOutputFormatter.php index 7ef6cd12477..88dd3f45452 100644 --- a/src/ChangesReporting/Output/JUnitOutputFormatter.php +++ b/src/ChangesReporting/Output/JUnitOutputFormatter.php @@ -87,8 +87,9 @@ private function appendSystemErrors( : ($systemError->getRelativeFilePath() ?? '') ; - $xmlError = $domDocument->createElement(self::XML_ELEMENT_ERROR, $systemError->getMessage()); + $xmlError = $domDocument->createElement(self::XML_ELEMENT_ERROR); $xmlError->setAttribute(self::XML_ATTRIBUTE_TYPE, 'Error'); + $xmlError->appendChild($domDocument->createTextNode($systemError->getMessage())); $xmlTestCase = $domDocument->createElement(self::XML_ELEMENT_TESTCASE); $xmlTestCase->setAttribute(self::XML_ATTRIBUTE_FILE, $filePath); @@ -120,8 +121,9 @@ private function appendFileDiffs( $rectorClasses = implode(' / ', $fileDiff->getRectorShortClasses()); - $xmlError = $domDocument->createElement(self::XML_ELEMENT_ERROR, $fileDiff->getDiff()); + $xmlError = $domDocument->createElement(self::XML_ELEMENT_ERROR); $xmlError->setAttribute(self::XML_ATTRIBUTE_TYPE, $rectorClasses); + $xmlError->appendChild($domDocument->createTextNode($fileDiff->getDiff())); $xmlTestCase = $domDocument->createElement(self::XML_ELEMENT_TESTCASE); $xmlTestCase->setAttribute(self::XML_ATTRIBUTE_FILE, $filePath);