File tree Expand file tree Collapse file tree 4 files changed +9
-3
lines changed
src/TextUI/XmlConfiguration/Migration
tests/end-to-end/migration/_files/migration-from-92 Expand file tree Collapse file tree 4 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ All notable changes of the PHPUnit 9.6 release series are documented in this fil
66
77### Fixed
88
9+ * [ #5405 ] ( https://github.com/sebastianbergmann/phpunit/issues/5405 ) : XML configuration migration does not migrate ` whitelist/file ` elements
910* Always use ` X.Y.Z ` version number (and not just ` X.Y ` ) of PHPUnit's version when checking whether a PHAR-distributed extension is compatible
1011
1112## [ 9.6.8] - 2023-05-11
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ final class MigrationBuilder
2828 IntroduceCoverageElement::class,
2929 MoveAttributesFromRootToCoverage::class,
3030 MoveAttributesFromFilterWhitelistToCoverage::class,
31- MoveWhitelistDirectoriesToCoverage ::class,
31+ MoveWhitelistIncludesToCoverage ::class,
3232 MoveWhitelistExcludesToCoverage::class,
3333 RemoveEmptyFilter::class,
3434 CoverageCloverToReport::class,
Original file line number Diff line number Diff line change 1616/**
1717 * @internal This class is not covered by the backward compatibility promise for PHPUnit
1818 */
19- final class MoveWhitelistDirectoriesToCoverage implements Migration
19+ final class MoveWhitelistIncludesToCoverage implements Migration
2020{
2121 /**
2222 * @throws MigrationException
@@ -39,7 +39,11 @@ public function migrate(DOMDocument $document): void
3939 $ coverage ->appendChild ($ include );
4040
4141 foreach (SnapshotNodeList::fromNodeList ($ whitelist ->childNodes ) as $ child ) {
42- if (!$ child instanceof DOMElement || $ child ->nodeName !== 'directory ' ) {
42+ if (!$ child instanceof DOMElement) {
43+ continue ;
44+ }
45+
46+ if (!($ child ->nodeName === 'directory ' || $ child ->nodeName === 'file ' )) {
4347 continue ;
4448 }
4549
Original file line number Diff line number Diff line change 1717 <filter >
1818 <whitelist processUncoveredFilesFromWhitelist =" true" >
1919 <directory suffix =" .php" >src</directory >
20+ <file >file.php</file >
2021 </whitelist >
2122 </filter >
2223</phpunit >
You can’t perform that action at this time.
0 commit comments