Skip to content

Commit c3c2eee

Browse files
Closes #6097 (using proposed changes from #6278)
1 parent f86657d commit c3c2eee

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

ChangeLog-11.5.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes of the PHPUnit 11.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
44

5+
## [11.5.28] - 2025-MM-DD
6+
7+
### Fixed
8+
9+
* [#6097](https://github.com/sebastianbergmann/phpunit/issues/6097): The `file` attribute of `<testClass>` node of XML test list can be wrong
10+
511
## [11.5.27] - 2025-07-11
612

713
### Fixed
@@ -251,6 +257,7 @@ All notable changes of the PHPUnit 11.5 release series are documented in this fi
251257
* [#6055](https://github.com/sebastianbergmann/phpunit/issues/6055): `assertNotContainsOnly()` (use `assertContainsNotOnlyArray()`, `assertContainsNotOnlyBool()`, `assertContainsNotOnlyCallable()`, `assertContainsNotOnlyFloat()`, `assertContainsNotOnlyInt()`, `assertContainsNotOnlyIterable()`, `assertContainsNotOnlyNumeric()`, `assertContainsNotOnlyObject()`, `assertContainsNotOnlyResource()`, `assertContainsNotOnlyClosedResource()`, `assertContainsNotOnlyScalar()`, or `assertContainsNotOnlyString()` instead)
252258
* [#6059](https://github.com/sebastianbergmann/phpunit/issues/6059): `containsOnly()` (use `containsOnlyArray()`, `containsOnlyBool()`, `containsOnlyCallable()`, `containsOnlyFloat()`, `containsOnlyInt()`, `containsOnlyIterable()`, `containsOnlyNumeric()`, `containsOnlyObject()`, `containsOnlyResource()`, `containsOnlyClosedResource()`, `containsOnlyScalar()`, or `containsOnlyString()` instead)
253259

260+
[11.5.28]: https://github.com/sebastianbergmann/phpunit/compare/11.5.27...11.5
254261
[11.5.27]: https://github.com/sebastianbergmann/phpunit/compare/11.5.26...11.5.27
255262
[11.5.26]: https://github.com/sebastianbergmann/phpunit/compare/11.5.25...11.5.26
256263
[11.5.25]: https://github.com/sebastianbergmann/phpunit/compare/11.5.24...11.5.25

src/TextUI/Command/Commands/ListTestsAsXmlCommand.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@
1010
namespace PHPUnit\TextUI\Command;
1111

1212
use const PHP_EOL;
13+
use function assert;
1314
use function file_put_contents;
1415
use function ksort;
1516
use function sprintf;
1617
use PHPUnit\Framework\TestCase;
1718
use PHPUnit\Runner\PhptTestCase;
19+
use ReflectionClass;
1820
use XMLWriter;
1921

2022
/**
@@ -70,9 +72,13 @@ public function execute(): Result
7072
$writer->endElement();
7173
}
7274

75+
$file = (new ReflectionClass($test))->getFileName();
76+
77+
assert($file !== false);
78+
7379
$writer->startElement('testClass');
7480
$writer->writeAttribute('name', $test::class);
75-
$writer->writeAttribute('file', $test->valueObjectForEvents()->file());
81+
$writer->writeAttribute('file', $file);
7682

7783
$currentTestClass = $test::class;
7884
}

0 commit comments

Comments
 (0)