diff --git a/RELEASE-NOTES-1.43 b/RELEASE-NOTES-1.43 index 5f52da89def..fd3fbcf0e6d 100644 --- a/RELEASE-NOTES-1.43 +++ b/RELEASE-NOTES-1.43 @@ -140,6 +140,8 @@ because of Phabricator reports. === Other changes in 1.43 === +* Class aliases to support the old PHPUnit 4 style un-namespaced `PHPUnit_` + classes (such as PHPUnit_Framework_Error) have been removed. * … == Compatibility == diff --git a/tests/common/TestsAutoLoader.php b/tests/common/TestsAutoLoader.php index a84a7eb6326..ca957307849 100644 --- a/tests/common/TestsAutoLoader.php +++ b/tests/common/TestsAutoLoader.php @@ -1,8 +1,5 @@ "$testDir/phpunit/suites/SuiteEventsTrait.php", ]; // phpcs:enable - -/** - * Alias any PHPUnit 4 era PHPUnit_... class - * to its PHPUnit 6 replacement. For most classes - * this is a direct _ -> \ replacement, but for - * some others we might need to maintain a manual - * mapping. Once we drop support for PHPUnit 4 this - * should be considered deprecated and eventually removed. - */ -spl_autoload_register( static function ( $class ) { - if ( !str_starts_with( $class, 'PHPUnit_' ) ) { - // Skip if it doesn't start with the old prefix - return; - } - - // Classes that don't map 100% - $map = [ - 'PHPUnit_Framework_TestSuite_DataProvider' => DataProviderTestSuite::class, - 'PHPUnit_Framework_Error' => Error::class, - ]; - - $newForm = $map[$class] ?? str_replace( '_', '\\', $class ); - - if ( class_exists( $newForm ) || interface_exists( $newForm ) ) { - // If the new class name exists, alias - // the old name to it. - class_alias( $newForm, $class ); - } -} );