diff --git a/ChangeLog-8.1.md b/ChangeLog-8.1.md new file mode 100644 index 00000000000..0c37d9cccb9 --- /dev/null +++ b/ChangeLog-8.1.md @@ -0,0 +1,16 @@ +# Changes in PHPUnit 8.1 + +All notable changes of the PHPUnit 8.1 release series are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. + +## [8.1.0] - 2019-MM-DD + +### Added + +* Information on test groups in the TestDox XML report is now stored in `group` elements that are child nodes of `test` + +### Changed + +* The `groups` attribute on the `test` element in the TestDox XML report is now deprecated + +[8.1.0]: https://github.com/sebastianbergmann/phpunit/compare/8.0...8.1.0 + diff --git a/src/Util/TestDox/XmlResultPrinter.php b/src/Util/TestDox/XmlResultPrinter.php index b161a11884b..ee4536b20e4 100644 --- a/src/Util/TestDox/XmlResultPrinter.php +++ b/src/Util/TestDox/XmlResultPrinter.php @@ -172,6 +172,14 @@ function ($group) { $node->setAttribute('size', (string) $test->getSize()); $node->setAttribute('groups', \implode(',', $groups)); + foreach ($groups as $group) { + $groupNode = $this->document->createElement('group'); + + $groupNode->setAttribute('name', $group); + + $node->appendChild($groupNode); + } + $inlineAnnotations = \PHPUnit\Util\Test::getInlineAnnotations(\get_class($test), $test->getName()); if (isset($inlineAnnotations['given'], $inlineAnnotations['when'], $inlineAnnotations['then'])) { diff --git a/tests/end-to-end/loggers/testdox-xml.phpt b/tests/end-to-end/loggers/testdox-xml.phpt index b428a74efc5..acc52faf086 100644 --- a/tests/end-to-end/loggers/testdox-xml.phpt +++ b/tests/end-to-end/loggers/testdox-xml.phpt @@ -18,20 +18,48 @@ PHPUnit %s by Sebastian Bergmann and contributors. .FEISRW.FEISRW 14 / 14 (100%) - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +