diff --git a/tests/phpunit/suites/ExtensionsUnitTestSuite.php b/tests/phpunit/suites/ExtensionsUnitTestSuite.php index eed59a6746c..bd8ed45fd7f 100644 --- a/tests/phpunit/suites/ExtensionsUnitTestSuite.php +++ b/tests/phpunit/suites/ExtensionsUnitTestSuite.php @@ -13,20 +13,11 @@ class ExtensionsUnitTestSuite extends TestSuite { if ( !defined( 'MW_PHPUNIT_EXTENSIONS_PATHS' ) ) { throw new RuntimeException( 'The PHPUnit bootstrap was not loaded' ); } - $paths = []; + + $suffixes = [ 'Test.php' ]; + $fileIterator = new Facade(); foreach ( MW_PHPUNIT_EXTENSIONS_PATHS as $path ) { - // Note that we don't load settings, so we expect to find extensions in their - // default location - // Standardize directory separators for Windows compatibility. - if ( str_contains( strtr( $path, '\\', '/' ), '/extensions/' ) ) { - $paths[] = "$path/tests/phpunit/unit"; - } - } - foreach ( array_unique( $paths ) as $path ) { - $suffixes = [ 'Test.php' ]; - $fileIterator = new Facade(); - $matchingFiles = $fileIterator->getFilesAsArray( $path, $suffixes ); - $this->addTestFiles( $matchingFiles ); + $this->addTestFiles( $fileIterator->getFilesAsArray( "$path/tests/phpunit/unit", $suffixes ) ); } }