8000 bug #29265 [Bridge/PhpUnit] Use composer to download phpunit (nicolas… · symfony/symfony@e166d96 · GitHub
[go: up one dir, main page]

Skip to content

Commit e166d96

Browse files
bug #29265 [Bridge/PhpUnit] Use composer to download phpunit (nicolas-grekas)
This PR was merged into the 3.4 branch. Discussion ---------- [Bridge/PhpUnit] Use composer to download phpunit | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #27753, #29263, #29264 | License | MIT | Doc PR | - Commits ------- e823f1d [Bridge/PhpUnit] Use composer to download phpunit
2 parents 9e0f8e7 + e823f1d commit e166d96

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

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

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212

1313
// Please update when phpunit needs to be reinstalled with fresh deps:
14-
// Cache-Id-Version: 2017-11-22 09:30 UTC
14+
// Cache-Id-Version: 2018-11-20 15:30 UTC
1515

1616
error_reporting(-1);
1717

@@ -60,29 +60,7 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
6060

6161
@mkdir($PHPUNIT_DIR, 0777, true);
6262
chdir($PHPUNIT_DIR);
63-
if (file_exists("phpunit-$PHPUNIT_VERSION")) {
64-
passthru(sprintf('\\' === DIRECTORY_SEPARATOR ? '(del /S /F /Q %s & rmdir %1$s) >nul': 'rm -rf %s', "phpunit-$PHPUNIT_VERSION"));
65-
}
66-
if (extension_loaded('openssl') && filter_var(ini_get('allow_url_fopen'), FILTER_VALIDATE_BOOLEAN) && !isset($_SERVER['http_proxy']) && !isset($_SERVER['https_proxy'])) {
67-
$remoteZip = "https://github.com/sebastianbergmann/phpunit/archive/$PHPUNIT_VERSION.zip";
68-
$remoteZipStream = @fopen($remoteZip, 'rb');
69-
if (!$remoteZipStream) {
70-
throw new \RuntimeException("Could not find $remoteZip");
71-
}
72-
stream_copy_to_stream($remoteZipStream, fopen("$PHPUNIT_VERSION.zip", 'wb'));
73-
} elseif ('\\' === DIRECTORY_SEPARATOR) {
74-
passthru("certutil -urlcache -split -f \"https://github.com/sebastianbergmann/phpunit/archive/$PHPUNIT_VERSION.zip\" $PHPUNIT_VERSION.zip");
75-
} else {
76-
@unlink("$PHPUNIT_VERSION.zip");
77-
passthru("wget -q https://github.com/sebastianbergmann/phpunit/archive/$PHPUNIT_VERSION.zip");
78-
}
79-
if (!class_exists('ZipArchive')) {
80-
throw new \Exception('simple-phpunit requires the "zip" PHP extension to be installed and enabled in order to uncompress the downloaded PHPUnit packages.');
81-
}
82-
$zip = new ZipArchive();
83-
$zip->open("$PHPUNIT_VERSION.zip");
84-
$zip->extractTo(getcwd());
85-
$zip->close();
63+
passthru("$COMPOSER create-project --no-install --prefer-dist --no-scripts --no-plugins --no-progress --ansi phpunit/phpunit phpunit-$PHPUNIT_VERSION \"$PHPUNIT_VERSION.*\"");
8664
chdir("phpunit-$PHPUNIT_VERSION");
8765
if ($SYMFONY_PHPUNIT_REMOVE) {
8866
passthru("$COMPOSER remove --no-update ".$SYMFONY_PHPUNIT_REMOVE);

0 commit comments

Comments
 (0)
0