Skip to content

Commit

Permalink
minor #21303 simple-phpunit requires the zip extension (dbu)
Browse files Browse the repository at this point in the history
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 | #21060
| License       | MIT
| Doc PR        | -

Commits
-------

6628e76 simple-phpunit requires the zip extension
  • Loading branch information
stof committed Jan 16, 2017
2 parents 39d975b + 6628e76 commit 7a90fcb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/Symfony/Bridge/PhpUnit/bin/simple-phpunit
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
@unlink("$PHPUNIT_VERSION.zip");
passthru("wget https://github.com/sebastianbergmann/phpunit/archive/$PHPUNIT_VERSION.zip");
}
if (!class_exists('ZipArchive')) {
throw new \Exception('simple-phpunit requires the "zip" PHP extension to be installed and enabled in order to uncompress the downloaded PHPUnit packages.');
}
$zip = new ZipArchive();
$zip->open("$PHPUNIT_VERSION.zip");
$zip->extractTo(getcwd());
Expand Down
3 changes: 2 additions & 1 deletion src/Symfony/Bridge/PhpUnit/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"php": ">=5.3.3"
},
"suggest": {
"symfony/debug": "For tracking deprecated interfaces usages at runtime with DebugClassLoader"
"symfony/debug": "For tracking deprecated interfaces usages at runtime with DebugClassLoader",
"ext-zip": "Zip support is required when using bin/simple-phpunit"
},
"autoload": {
"files": [ "bootstrap.php" ],
Expand Down

0 comments on commit 7a90fcb

Please sign in to comment.