Skip to content

Commit 71f66b7

Browse files
committed
Add SYMFONY_PHPUNIT_REQUIRE env variable Fixes #39387
1 parent 0fa7393 commit 71f66b7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bin/simple-phpunit.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@
167167
}
168168
}
169169
$SYMFONY_PHPUNIT_REMOVE = $getEnvVar('SYMFONY_PHPUNIT_REMOVE', 'phpspec/prophecy'.($PHPUNIT_VERSION < 6.0 ? ' symfony/yaml' : ''));
170-
$configurationHash = md5(implode(\PHP_EOL, [md5_file(__FILE__), $SYMFONY_PHPUNIT_REMOVE, (int) $PHPUNIT_REMOVE_RETURN_TYPEHINT]));
170+
$SYMFONY_PHPUNIT_REQUIRE = $getEnvVar('SYMFONY_PHPUNIT_REQUIRE', '');
171+
$configurationHash = md5(implode(\PHP_EOL, [md5_file(__FILE__), $SYMFONY_PHPUNIT_REMOVE, $SYMFONY_PHPUNIT_REQUIRE, (int) $PHPUNIT_REMOVE_RETURN_TYPEHINT]));
171172
$PHPUNIT_VERSION_DIR = sprintf('phpunit-%s-%d', $PHPUNIT_VERSION, $PHPUNIT_REMOVE_RETURN_TYPEHINT);
172173
if (!file_exists("$PHPUNIT_DIR/$PHPUNIT_VERSION_DIR/phpunit") || $configurationHash !== @file_get_contents("$PHPUNIT_DIR/.$PHPUNIT_VERSION_DIR.md5")) {
173174
// Build a standalone phpunit without symfony/yaml nor prophecy by default
@@ -224,6 +225,9 @@
224225
if ($SYMFONY_PHPUNIT_REMOVE) {
225226
$passthruOrFail("$COMPOSER remove --no-update ".$SYMFONY_PHPUNIT_REMOVE);
226227
}
228+
if ($SYMFONY_PHPUNIT_REQUIRE) {
229+
$passthruOrFail("$COMPOSER require --no-update ".$SYMFONY_PHPUNIT_REQUIRE);
230+
}
227231
if (5.1 <= $PHPUNIT_VERSION && $PHPUNIT_VERSION < 5.4) {
228232
$passthruOrFail("$COMPOSER require --no-update phpunit/phpunit-mock-objects \"~3.1.0\"");
229233
}

0 commit comments

Comments
 (0)