Skip to content

Commit 7a90fcb

Browse files
committed
minor symfony#21303 simple-phpunit requires the zip extension (dbu)
This PR was merged into the 3.2 branch. Discussion ---------- simple-phpunit requires the zip extension without the zip extension enabled, i get `PHP Fatal error: Uncaught Error: Class 'ZipArchive' not found in .../vendor/bin/simple-phpunit:46` | Q | A | ------------- | --- | Branch? | 3.2 (first version containing the script) | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#21060 | License | MIT | Doc PR | - Commits ------- 6628e76 simple-phpunit requires the zip extension
2 parents 39d975b + 6628e76 commit 7a90fcb

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
4343
@unlink("$PHPUNIT_VERSION.zip");
4444
passthru("wget https://github.com/sebastianbergmann/phpunit/archive/$PHPUNIT_VERSION.zip");
4545
}
46+
if (!class_exists('ZipArchive')) {
47+
throw new \Exception('simple-phpunit requires the "zip" PHP extension to be installed and enabled in order to uncompress the downloaded PHPUnit packages.');
48+
}
4649
$zip = new ZipArchive();
4750
$zip->open("$PHPUNIT_VERSION.zip");
4851
$zip->extractTo(getcwd());

src/Symfony/Bridge/PhpUnit/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"php": ">=5.3.3"
2222
},
2323
"suggest": {
24-
"symfony/debug": "For tracking deprecated interfaces usages at runtime with DebugClassLoader"
24+
"symfony/debug": "For tracking deprecated interfaces usages at runtime with DebugClassLoader",
25+
"ext-zip": "Zip support is required when using bin/simple-phpunit"
2526
},
2627
"autoload": {
2728
"files": [ "bootstrap.php" ],

0 commit comments

Comments
 (0)