Skip to content

Commit ed279c7

Browse files
[PhpUnitBridge] Fix support for the NO_COLOR env var
1 parent 1572c5b commit ed279c7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: bin/simple-phpunit.php

+2-2
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)