Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 79c4bfb

Browse filesBrowse 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
Copy full SHA for 79c4bfb

File tree

1 file changed

+2
-2
lines changed
Filter options

1 file changed

+2
-2
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php
+2-2Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.