Skip to content

Commit f93e0c2

Browse files
Emil Anderssonnicolas-grekas
Emil Andersson
authored andcommitted
[ci] Phpunit tests wont run if composer is installed in a wrapper
1 parent 481bf66 commit f93e0c2

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

phpunit

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,11 @@ require __DIR__.'/src/Symfony/Component/Process/ProcessUtils.php';
2222
$PHPUNIT_VERSION = PHP_VERSION_ID >= 70000 ? '5.0' : '4.8';
2323
$PHPUNIT_DIR = __DIR__.'/.phpunit';
2424
$PHP = defined('PHP_BINARY') ? PHP_BINARY : 'php';
25-
26-
if (!file_exists($COMPOSER = __DIR__.'/composer.phar')) {
27-
$COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? `where.exe composer.phar` : (`which composer.phar` ?: `which composer`));
28-
if (!file_exists($COMPOSER)) {
29-
stream_copy_to_stream(
30-
fopen('https://getcomposer.org/composer.phar', 'rb'),
31-
fopen($COMPOSER = __DIR__.'/composer.phar', 'wb')
32-
);
33-
}
34-
}
35-
3625
$PHP = ProcessUtils::escapeArgument($PHP);
37-
$COMPOSER = $PHP.' '.ProcessUtils::escapeArgument($COMPOSER);
26+
27+
$COMPOSER = file_exists($COMPOSER = __DIR__.'/composer.phar') || ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? `where.exe composer.phar` : `which composer.phar`))
28+
? $PHP.' '.ProcessUtils::escapeArgument($COMPOSER)
29+
: 'composer';
3830

3931
if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__FILE__) !== @file_get_contents("$PHPUNIT_DIR/.md5")) {
4032
// Build a standalone phpunit without symfony/yaml

0 commit comments

Comments
 (0)