diff --git a/ChangeLog-11.2.md b/ChangeLog-11.2.md index a97c02ea31e..2ab7accca94 100644 --- a/ChangeLog-11.2.md +++ b/ChangeLog-11.2.md @@ -2,6 +2,12 @@ All notable changes of the PHPUnit 11.2 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. +## [11.2.1] - 2024-MM-DD + +### Fixed + +* [#5859](https://github.com/sebastianbergmann/phpunit/issues/5859): XML Configuration File Migrator does not remove `cacheDirectory` attribute from `` element when migrating from PHPUnit 11.1 to PHPUnit 11.2 + ## [11.2.0] - 2024-06-07 ### Added @@ -14,4 +20,5 @@ All notable changes of the PHPUnit 11.2 release series are documented in this fi * [#5800](https://github.com/sebastianbergmann/phpunit/issues/5800): Support for targeting traits with `#[CoversClass]` and `#[UsesClass]` attributes +[11.2.1]: https://github.com/sebastianbergmann/phpunit/compare/11.2.0...11.2 [11.2.0]: https://github.com/sebastianbergmann/phpunit/compare/11.1.3...11.2.0 diff --git a/src/TextUI/Configuration/Xml/Migration/MigrationBuilder.php b/src/TextUI/Configuration/Xml/Migration/MigrationBuilder.php index bb0ed6df1c1..c11ce1d5825 100644 --- a/src/TextUI/Configuration/Xml/Migration/MigrationBuilder.php +++ b/src/TextUI/Configuration/Xml/Migration/MigrationBuilder.php @@ -69,6 +69,10 @@ '11.0' => [ ReplaceRestrictDeprecationsWithIgnoreDeprecations::class, ], + + '11.1' => [ + RemoveCoverageElementCacheDirectoryAttribute::class, + ], ]; /** diff --git a/tests/_files/XmlConfigurationMigration/input-5859.xml b/tests/_files/XmlConfigurationMigration/input-5859.xml new file mode 100644 index 00000000000..ee91318f785 --- /dev/null +++ b/tests/_files/XmlConfigurationMigration/input-5859.xml @@ -0,0 +1,5 @@ + + + + diff --git a/tests/_files/XmlConfigurationMigration/output-5859.xml b/tests/_files/XmlConfigurationMigration/output-5859.xml new file mode 100644 index 00000000000..60ecbbc7fff --- /dev/null +++ b/tests/_files/XmlConfigurationMigration/output-5859.xml @@ -0,0 +1,5 @@ + + + + diff --git a/tests/unit/TextUI/Configuration/Xml/MigratorTest.php b/tests/unit/TextUI/Configuration/Xml/MigratorTest.php index b05e1e0bccd..f8ce7a25051 100644 --- a/tests/unit/TextUI/Configuration/Xml/MigratorTest.php +++ b/tests/unit/TextUI/Configuration/Xml/MigratorTest.php @@ -10,6 +10,7 @@ namespace PHPUnit\TextUI\XmlConfiguration; use PHPUnit\Framework\Attributes\TestDox; +use PHPUnit\Framework\Attributes\Ticket; use PHPUnit\Framework\TestCase; use PHPUnit\Util\Xml\Loader as XmlLoader; @@ -40,4 +41,18 @@ public function testCanMigratePhpUnit95Configuration(): void ), ); } + + #[TestDox('Remove cacheDirectory attribute from element when migrating from PHPUnit 11.1 to PHPUnit 11.2')] + #[Ticket('https://github.com/sebastianbergmann/phpunit/issues/5859')] + public function testIssue5859(): void + { + $this->assertEquals( + (new XmlLoader)->loadFile(__DIR__ . '/../../../../_files/XmlConfigurationMigration/output-5859.xml'), + (new XmlLoader)->load( + (new Migrator)->migrate( + __DIR__ . '/../../../../_files/XmlConfigurationMigration/input-5859.xml', + ), + ), + ); + } }