From 605d9879e71ad365000eaaa381c36bdbf57ce898 Mon Sep 17 00:00:00 2001 From: Brandon Jackson Date: Tue, 24 Feb 2026 10:18:36 -0600 Subject: [PATCH] Properly build text node for junit output --- src/ChangesReporting/Output/JUnitOutputFormatter.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ChangesReporting/Output/JUnitOutputFormatter.php b/src/ChangesReporting/Output/JUnitOutputFormatter.php index ad7d2dbc7bd..bceea639a9e 100644 --- a/src/ChangesReporting/Output/JUnitOutputFormatter.php +++ b/src/ChangesReporting/Output/JUnitOutputFormatter.php @@ -82,8 +82,9 @@ private function appendSystemErrors(ProcessResult $processResult, Configuration } foreach ($processResult->getSystemErrors() as $systemError) { $filePath = $configuration->isReportingWithRealPath() ? $systemError->getAbsoluteFilePath() ?? '' : $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); $xmlTestCase->setAttribute(self::XML_ATTRIBUTE_NAME, $filePath . ':' . $systemError->getLine()); @@ -101,8 +102,9 @@ private function appendFileDiffs(ProcessResult $processResult, Configuration $co foreach ($fileDiffs as $fileDiff) { $filePath = $configuration->isReportingWithRealPath() ? $fileDiff->getAbsoluteFilePath() ?? '' : $fileDiff->getRelativeFilePath() ?? ''; $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); $xmlTestCase->setAttribute(self::XML_ATTRIBUTE_NAME, $filePath . ':' . $fileDiff->getFirstLineNumber());