Skip to content

Commit 09e5128

Browse files
Fix in simple-phpunit script
1 parent a707bbf commit 09e5128

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/Symfony/Bridge/PhpUnit/bin/simple-phpunit

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ $COMPOSER = file_exists($COMPOSER = $oldPwd.'/composer.phar') || ($COMPOSER = rt
3838
? $PHP.' '.escapeshellarg($COMPOSER)
3939
: 'composer';
4040

41-
if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__FILE__)."\n".getenv('SYMFONY_PHPUNIT_REMOVE') !== @file_get_contents("$PHPUNIT_DIR/.$PHPUNIT_VERSION.md5")) {
41+
if (false === $SYMFONY_PHPUNIT_REMOVE = getenv('SYMFONY_PHPUNIT_REMOVE')) {
42+
$SYMFONY_PHPUNIT_REMOVE = 'phpspec/prophecy symfony/yaml';
43+
}
44+
45+
if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__FILE__)."\n".$SYMFONY_PHPUNIT_REMOVE !== @file_get_contents("$PHPUNIT_DIR/.$PHPUNIT_VERSION.md5")) {
4246
// Build a standalone phpunit without symfony/yaml nor prophecy by default
4347

4448
@mkdir($PHPUNIT_DIR, 0777, true);
@@ -60,8 +64,7 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
6064
$zip->extractTo(getcwd());
6165
$zip->close();
6266
chdir("phpunit-$PHPUNIT_VERSION");
63-
$SYMFONY_PHPUNIT_REMOVE = getenv('SYMFONY_PHPUNIT_REMOVE');
64-
passthru("$COMPOSER remove --no-update ".('' === $SYMFONY_PHPUNIT_REMOVE ?: 'phpspec/prophecy symfony/yaml'));
67+
passthru("$COMPOSER remove --no-update ".$SYMFONY_PHPUNIT_REMOVE);
6568
if (5.1 <= $PHPUNIT_VERSION && $PHPUNIT_VERSION < 5.4) {
6669
passthru("$COMPOSER require --no-update phpunit/phpunit-mock-objects \"~3.1.0\"");
6770
}
@@ -83,7 +86,7 @@ Symfony\Bridge\PhpUnit\TextUI\Command::main();
8386
EOPHP
8487
);
8588
chdir('..');
86-
file_put_contents(".$PHPUNIT_VERSION.md5", md5_file(__FILE__)."\n".getenv('SYMFONY_PHPUNIT_REMOVE'));
89+
file_put_contents(".$PHPUNIT_VERSION.md5", md5_file(__FILE__)."\n".$SYMFONY_PHPUNIT_REMOVE);
8790
chdir($oldPwd);
8891

8992
}

0 commit comments

Comments
 (0)