diff --git a/src/TextUI/XmlConfiguration/Migration/MigrationBuilder.php b/src/TextUI/XmlConfiguration/Migration/MigrationBuilder.php index a674267918c..6702f622a5b 100644 --- a/src/TextUI/XmlConfiguration/Migration/MigrationBuilder.php +++ b/src/TextUI/XmlConfiguration/Migration/MigrationBuilder.php @@ -42,6 +42,7 @@ final class MigrationBuilder '9.5' => [ RemoveListeners::class, + RemoveTestSuiteLoaderAttributes::class, ], ]; diff --git a/src/TextUI/XmlConfiguration/Migration/Migrations/RemoveTestSuiteLoaderAttributes.php b/src/TextUI/XmlConfiguration/Migration/Migrations/RemoveTestSuiteLoaderAttributes.php new file mode 100644 index 00000000000..e1384dcb5fb --- /dev/null +++ b/src/TextUI/XmlConfiguration/Migration/Migrations/RemoveTestSuiteLoaderAttributes.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PHPUnit\TextUI\XmlConfiguration; + +use DOMDocument; + +/** + * @internal This class is not covered by the backward compatibility promise for PHPUnit + */ +final class RemoveTestSuiteLoaderAttributes implements Migration +{ + public function migrate(DOMDocument $document): void + { + $root = $document->documentElement; + + if ($root->hasAttribute('testSuiteLoaderClass')) { + $root->removeAttribute('testSuiteLoaderClass'); + } + + if ($root->hasAttribute('testSuiteLoaderFile')) { + $root->removeAttribute('testSuiteLoaderFile'); + } + } +} diff --git a/tests/_files/XmlConfigurationMigration/input-9.5.xml b/tests/_files/XmlConfigurationMigration/input-9.5.xml index d6a87d275df..916ca07354d 100644 --- a/tests/_files/XmlConfigurationMigration/input-9.5.xml +++ b/tests/_files/XmlConfigurationMigration/input-9.5.xml @@ -1,6 +1,8 @@ + xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd" + testSuiteLoaderClass="Foo" + testSuiteLoaderFile="Foo.php">