From 52f52dd636d615d45019184d1001a902d809d956 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 30 Aug 2023 15:02:15 +0200 Subject: [PATCH] Disable color output in tests by default to avoid issues on windows, fixes #11598 --- tests/bootstrap.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 494fa6894..05b88f2f6 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -27,6 +27,11 @@ if (!class_exists(InstalledVersions::class, false)) { Platform::putEnv('COMPOSER_TESTS_ARE_RUNNING', '1'); +// ensure Windows color support detection does not attempt to use colors +// as this is dependent on env vars and not actual stream capabilities, see +// https://github.com/composer/composer/issues/11598 +Platform::putEnv('NO_COLOR', '1'); + // symfony/phpunit-bridge sets some default env vars which we do not need polluting the test env Platform::clearEnv('COMPOSER'); Platform::clearEnv('COMPOSER_VENDOR_DIR');