From abaed1988852ca122b9f138121eaf7211212f5f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Mirtes?= Date: Mon, 22 Aug 2022 15:00:18 +0200 Subject: [PATCH] Tests bootstrap - require InstalledVersions only if it's not declared yet (#11014) --- tests/bootstrap.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index e4fa7fa3c001..010ded939460 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -10,6 +10,7 @@ * file that was distributed with this source code. */ +use Composer\InstalledVersions; use Composer\Util\Platform; error_reporting(E_ALL); @@ -19,7 +20,11 @@ } 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'; Platform::putEnv('COMPOSER_TESTS_ARE_RUNNING', '1');