From 8fea773db6e1282bac6d630c71aff54132808673 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 9 Jul 2024 22:57:15 +0200 Subject: [PATCH 1/2] use more entropy with uniqid() --- Tests/DeprecationErrorHandler/log_file.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/DeprecationErrorHandler/log_file.phpt b/Tests/DeprecationErrorHandler/log_file.phpt index 7f114ab..51f8d6c 100644 --- a/Tests/DeprecationErrorHandler/log_file.phpt +++ b/Tests/DeprecationErrorHandler/log_file.phpt @@ -2,7 +2,7 @@ Test DeprecationErrorHandler with log file --FILE-- Date: Wed, 24 Jul 2024 10:06:13 +0200 Subject: [PATCH 2/2] [Console][PhpUnitBridge][VarDumper] Fix `NO_COLOR` empty value handling --- DeprecationErrorHandler.php | 2 +- bin/simple-phpunit.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DeprecationErrorHandler.php b/DeprecationErrorHandler.php index 2821d92..c2c0cbb 100644 --- a/DeprecationErrorHandler.php +++ b/DeprecationErrorHandler.php @@ -410,7 +410,7 @@ private static function hasColorSupport() } // Follow https://no-color.org/ - if (isset($_SERVER['NO_COLOR']) || false !== getenv('NO_COLOR')) { + if ('' !== ($_SERVER['NO_COLOR'] ?? getenv('NO_COLOR') ?: '')) { return false; } diff --git a/bin/simple-phpunit.php b/bin/simple-phpunit.php index 816e8d9..c409cd2 100644 --- a/bin/simple-phpunit.php +++ b/bin/simple-phpunit.php @@ -368,7 +368,7 @@ class_exists(\SymfonyExcludeListSimplePhpunit::class, false) && PHPUnit\Util\Bla } } -$cmd[0] = sprintf('%s %s --colors=%s', $PHP, escapeshellarg("$PHPUNIT_DIR/$PHPUNIT_VERSION_DIR/phpunit"), false === $getEnvVar('NO_COLOR') ? 'always' : 'never'); +$cmd[0] = sprintf('%s %s --colors=%s', $PHP, escapeshellarg("$PHPUNIT_DIR/$PHPUNIT_VERSION_DIR/phpunit"), '' === $getEnvVar('NO_COLOR', '') ? 'always' : 'never'); $cmd = str_replace('%', '%%', implode(' ', $cmd)).' %1$s'; if ('\\' === \DIRECTORY_SEPARATOR) { @@ -458,7 +458,7 @@ class SymfonyExcludeListSimplePhpunit { } } - array_splice($argv, 1, 0, ['--colors='.(false === $getEnvVar('NO_COLOR') ? 'always' : 'never')]); + array_splice($argv, 1, 0, ['--colors='.('' === $getEnvVar('NO_COLOR', '') ? 'always' : 'never')]); $_SERVER['argv'] = $argv; $_SERVER['argc'] = ++$argc; include "$PHPUNIT_DIR/$PHPUNIT_VERSION_DIR/phpunit";