49 lines
1.4 KiB
PHP
49 lines
1.4 KiB
PHP
<?PHP
|
|
/**
|
|
* Bootstraps tests by running provideEnv and then resetting the error handler.
|
|
*/
|
|
declare(strict_types = 1);
|
|
|
|
define('TL_FILE_DIRS', [
|
|
__DIR__ . '/../../../l10n/musdb/',
|
|
__DIR__ . '/../../../l10n/quality-web/',
|
|
__DIR__ . '/../../importer/dependencies/MDAllowedValueSets/l18n/',
|
|
]);
|
|
|
|
|
|
/**
|
|
* Autoloader for musdb.
|
|
*
|
|
* @param string $className Name of the class to load.
|
|
*
|
|
* @return void
|
|
*/
|
|
\spl_autoload_register(function(string $className):void {
|
|
|
|
// Try using class map as defined through /scripts/buildClassMap.php
|
|
|
|
foreach ([
|
|
__DIR__ . '/../tests',
|
|
__DIR__ . '/../src',
|
|
__DIR__ . '/../src/Checks',
|
|
__DIR__ . '/../src/Checks/Puqi',
|
|
__DIR__ . '/../src/Checks/Plausi',
|
|
__DIR__ . '/../../importer/dependencies/MDAllowedValueSets/src',
|
|
__DIR__ . '/../../importer/dependencies/MDAllowedValueSets/exceptions',
|
|
__DIR__ . '/../../importer/dependencies/MDErrorReporter/src',
|
|
__DIR__ . '/../../importer/dependencies/MDErrorReporter/exceptions',
|
|
__DIR__ . '/../../importer/dependencies/MDTlLoader/src',
|
|
__DIR__ . '/../../importer/dependencies/MDTlLoader/exceptions',
|
|
] as $classDir) {
|
|
|
|
if (\file_exists("$classDir/$className.php")) {
|
|
include "$classDir/$className.php";
|
|
return;
|
|
}
|
|
|
|
}
|
|
});
|
|
|
|
restore_error_handler();
|
|
restore_exception_handler();
|