From 77e643d0baa2b0cbf3132a14daaf2ed2fd238ed4 Mon Sep 17 00:00:00 2001 From: amcastror Date: Sat, 10 Mar 2018 15:48:33 -0300 Subject: [PATCH] [PhpUnitBridge] Ability to use different composer.json file --- src/Symfony/Bridge/PhpUnit/bin/simple-phpunit | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; }