bug53603.phpt 719 B

12345678910111213141516171819202122232425262728293031
  1. --TEST--
  2. Bug #53603 (ZipArchive should quiet stat errors)
  3. --EXTENSIONS--
  4. zip
  5. --FILE--
  6. <?php
  7. class TestStream {
  8. function url_stat($path, $flags) {
  9. if (!($flags & STREAM_URL_STAT_QUIET))
  10. trigger_error("not quiet");
  11. return array();
  12. }
  13. }
  14. stream_wrapper_register("teststream", "TestStream");
  15. $dirname = __DIR__ . '/';
  16. $file = $dirname . 'test_with_comment.zip';
  17. $zip = new ZipArchive;
  18. if ($zip->open($file) !== TRUE) {
  19. echo "open failed.\n";
  20. exit('failed');
  21. }
  22. $a = $zip->extractTo('teststream://test');
  23. var_dump($a);
  24. ?>
  25. --EXPECTF--
  26. Warning: ZipArchive::extractTo(teststream://test/foo): Failed to open stream: "TestStream::stream_open" call failed in %s on line %d
  27. bool(false)