Skip to content

Commit 0d26168

Browse files
committed
implicitly run all Composer commands non-interactively
1 parent 7a4a92d commit 0d26168

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

bin/simple-phpunit.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@
135135
'COMPOSER' => 'composer.json',
136136
'COMPOSER_VENDOR_DIR' => 'vendor',
137137
'COMPOSER_BIN_DIR' => 'bin',
138+
'COMPOSER_NO_INTERACTION' => '1',
138139
'SYMFONY_SIMPLE_PHPUNIT_BIN_DIR' => __DIR__,
139140
];
140141

@@ -231,13 +232,13 @@
231232
@copy("$PHPUNIT_VERSION_DIR/phpunit.xsd", 'phpunit.xsd');
232233
chdir("$PHPUNIT_VERSION_DIR");
233234
if ($SYMFONY_PHPUNIT_REMOVE) {
234-
$passthruOrFail("$COMPOSER remove --no-update --no-interaction ".$SYMFONY_PHPUNIT_REMOVE);
235+
$passthruOrFail("$COMPOSER remove --no-update ".$SYMFONY_PHPUNIT_REMOVE);
235236
}
236237
if ($SYMFONY_PHPUNIT_REQUIRE) {
237-
$passthruOrFail("$COMPOSER require --no-update --no-interaction ".$SYMFONY_PHPUNIT_REQUIRE);
238+
$passthruOrFail("$COMPOSER require --no-update ".$SYMFONY_PHPUNIT_REQUIRE);
238239
}
239240
if (5.1 <= $PHPUNIT_VERSION && $PHPUNIT_VERSION < 5.4) {
240-
$passthruOrFail("$COMPOSER require --no-update --no-interaction phpunit/phpunit-mock-objects \"~3.1.0\"");
241+
$passthruOrFail("$COMPOSER require --no-update phpunit/phpunit-mock-objects \"~3.1.0\"");
241242
}
242243

243244
if (preg_match('{\^((\d++\.)\d++)[\d\.]*$}', $info['requires']['php'], $phpVersion) && version_compare($phpVersion[2].'99', \PHP_VERSION, '<')) {
@@ -253,13 +254,13 @@
253254
if (realpath($p) === realpath($path)) {
254255
$path = $p;
255256
}
256-
$passthruOrFail("$COMPOSER require --no-update --no-interaction symfony/phpunit-bridge \"*@dev\"");
257+
$passthruOrFail("$COMPOSER require --no-update symfony/phpunit-bridge \"*@dev\"");
257258
$passthruOrFail("$COMPOSER config repositories.phpunit-bridge path ".escapeshellarg(str_replace('/', \DIRECTORY_SEPARATOR, $path)));
258259
if ('\\' === \DIRECTORY_SEPARATOR) {
259260
file_put_contents('composer.json', preg_replace('/^( {8})"phpunit-bridge": \{$/m', "$0\n$1 ".'"options": {"symlink": false},', file_get_contents('composer.json')));
260261
}
261262
} else {
262-
$passthruOrFail("$COMPOSER require --no-update --no-interaction symfony/phpunit-bridge \"*\"");
263+
$passthruOrFail("$COMPOSER require --no-update symfony/phpunit-bridge \"*\"");
263264
}
264265
$prevRoot = getenv('COMPOSER_ROOT_VERSION');
265266
putenv("COMPOSER_ROOT_VERSION=$PHPUNIT_VERSION.99");

0 commit comments

Comments
 (0)