1
0
Fork 0

Tests bootstrap - require InstalledVersions only if it's not declared yet (#11014)

pull/11023/head
Ondřej Mirtes 2022-08-22 15:00:18 +02:00 committed by GitHub
parent 476fb03fb1
commit b6028951b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -10,6 +10,7 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
use Composer\InstalledVersions;
use Composer\Util\Platform; use Composer\Util\Platform;
error_reporting(E_ALL); error_reporting(E_ALL);
@ -19,7 +20,11 @@ if (function_exists('date_default_timezone_set') && function_exists('date_defaul
} }
require __DIR__.'/../src/bootstrap.php'; require __DIR__.'/../src/bootstrap.php';
require __DIR__.'/../src/Composer/InstalledVersions.php';
if (!class_exists(InstalledVersions::class, false)) {
require __DIR__.'/../src/Composer/InstalledVersions.php';
}
require __DIR__.'/Composer/Test/TestCase.php'; require __DIR__.'/Composer/Test/TestCase.php';
Platform::putEnv('COMPOSER_TESTS_ARE_RUNNING', '1'); Platform::putEnv('COMPOSER_TESTS_ARE_RUNNING', '1');