Skip to content

Commit 79c4bfb

Browse files
committed
bug #50534 [PhpUnitBridge] Fix support for the NO_COLOR env var (nicolas-grekas)
This PR was merged into the 5.4 branch. Discussion ---------- [PhpUnitBridge] Fix support for the NO_COLOR env var | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Commits ------- fe4920b [PhpUnitBridge] Fix support for the NO_COLOR env var
2 parents 094729f + fe4920b commit 79c4bfb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ class_exists(\SymfonyExcludeListSimplePhpunit::class, false) && PHPUnit\Util\Bla
368368
}
369369
}
370370

371-
$cmd[0] = sprintf('%s %s --colors=always', $PHP, escapeshellarg("$PHPUNIT_DIR/$PHPUNIT_VERSION_DIR/phpunit"));
371+
$cmd[0] = sprintf('%s %s --colors=%s', $PHP, escapeshellarg("$PHPUNIT_DIR/$PHPUNIT_VERSION_DIR/phpunit"), false === $getEnvVar('NO_COLOR') ? 'always' : 'never');
372372
$cmd = str_replace('%', '%%', implode(' ', $cmd)).' %1$s';
373373

374374
if ('\\' === \DIRECTORY_SEPARATOR) {
@@ -435,7 +435,7 @@ class SymfonyExcludeListSimplePhpunit
435435
{
436436
}
437437
}
438-
array_splice($argv, 1, 0, ['--colors=always']);
438+
array_splice($argv, 1, 0, ['--colors='.(false === $getEnvVar('NO_COLOR') ? 'always' : 'never')]);
439439
$_SERVER['argv'] = $argv;
440440
$_SERVER['argc'] = ++$argc;
441441
include "$PHPUNIT_DIR/$PHPUNIT_VERSION_DIR/phpunit";

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy