diff --git a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit index 2f97e32e11..a549cd7da4 100755 --- a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit +++ b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit @@ -26,8 +26,13 @@ if (PHP_VERSION_ID >= 70200) { $PHPUNIT_VERSION = '4.8'; } +if ('composer.json' !== $COMPOSER_JSON = getenv('COMPOSER') ?: 'composer.json') { + putenv('COMPOSER=composer.json'); + $_SERVER['COMPOSER'] = $_ENV['COMPOSER'] = 'composer.json'; +} + $root = __DIR__; -while (!file_exists($root.'/composer.json') || file_exists($root.'/DeprecationErrorHandler.php')) { +while (!file_exists($root.'/'.$COMPOSER_JSON) || file_exists($root.'/DeprecationErrorHandler.php')) { if ($root === dirname($root)) { break; }