phpunit: Fix bootstrap script when no extensions are installed

Change-Id: I9de2c7711fc41f83a0b9e6783fcf085cedb2a9c9
(cherry picked from commit 2544c2cd31fefece71adc0ec03112614e41bd9ec)
This commit is contained in:
Bartosz Dziewoński 2025-02-21 23:00:46 +01:00 committed by Reedy
parent 1364192bb9
commit 3f2281da04
2 changed files with 2 additions and 1 deletions

View file

@ -143,7 +143,7 @@ if ( !$hasIntegrationTests ) {
// For simplicity, getPHPUnitExtensionsAndSkins uses `\n\nTESTPATHS\n\n` to separate the lists of JSON files and
// additional test paths, so split the output into the individual lists.
[ $pathsToJsonFilesStr, $testPathsStr ] = explode( "\n\nTESTPATHS\n\n", $extensionData );
$pathsToJsonFiles = explode( "\n", $pathsToJsonFilesStr );
$pathsToJsonFiles = $pathsToJsonFilesStr ? explode( "\n", $pathsToJsonFilesStr ) : [];
$testPaths = explode( "\n", $testPathsStr );
$extensionProcessor = new ExtensionProcessor();

View file

@ -36,6 +36,7 @@ echo "\n\nTESTPATHS\n\n";
// just the config needed to create a hook container, as early as when ExtensionsTestSuite::suite is called.
// This particular hack can be removed once the UnitTestsList hook is removed (T298509)
$registry = ExtensionRegistry::getInstance();
$paths = [];
foreach ( $registry->getAllThings() as $info ) {
$paths[] = dirname( $info['path'] ) . '/tests/phpunit';
}