Skip to content

Commit 5780475

Browse files
Merge branch '3.4' into 4.2
* 3.4: cs fix cs fix [PHPUnit-Bridge] override some environment variables [TwigBridge] Remove use spaceless tag [translation] Update defaut format from yml to yaml Change default log level for output streams update docblock to match the actual behavior compatibility with phpunit8 [Debug][DebugClassLoader] Detect annotations before blank docblock lines on final and internal methods Added translations for chineese language.
2 parents a2381f1 + 292b424 commit 5780475

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

bin/simple-phpunit

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,7 @@ if (PHP_VERSION_ID >= 70200) {
5656
$PHPUNIT_VERSION = '4.8';
5757
}
5858

59-
if ('composer.json' !== $COMPOSER_JSON = getenv('COMPOSER') ?: 'composer.json') {
60-
putenv('COMPOSER=composer.json');
61-
$_SERVER['COMPOSER'] = $_ENV['COMPOSER'] = 'composer.json';
62-
}
59+
$COMPOSER_JSON = getenv('COMPOSER') ?: 'composer.json';
6360

6461
$root = __DIR__;
6562
while (!file_exists($root.'/'.$COMPOSER_JSON) || file_exists($root.'/DeprecationErrorHandler.php')) {
@@ -77,6 +74,19 @@ if ('phpdbg' === PHP_SAPI) {
7774
$PHP .= ' -qrr';
7875
}
7976

77+
$defaultEnvs = [
78+
'COMPOSER' => 'composer.json',
79+
'COMPOSER_VENDOR_DIR' => 'vendor',
80+
'COMPOSER_BIN_DIR' => 'bin',
81+
];
82+
83+
foreach ($defaultEnvs as $envName => $envValue) {
84+
if ($envValue !== getenv($envName)) {
85+
putenv("$envName=$envValue");
86+
$_SERVER[$envName] = $_ENV[$envName] = $envValue;
87+
}
88+
}
89+
8090
$COMPOSER = file_exists($COMPOSER = $oldPwd.'/composer.phar') || ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer.phar`) : `which composer.phar 2> /dev/null`))
8191
? $PHP.' '.escapeshellarg($COMPOSER)
8292
: 'composer';

0 commit comments

Comments
 (0)