bug53603.phpt 739 B

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