zlib_wrapper_ftruncate_basic.phpt 615 B

1234567891011121314151617181920212223242526272829303132
  1. --TEST--
  2. Test function ftruncate() on zlib wrapper by calling it with its expected arguments
  3. --SKIPIF--
  4. <?php
  5. if (!extension_loaded("zlib")) {
  6. print "skip - ZLIB extension not loaded";
  7. }
  8. ?>
  9. --FILE--
  10. <?php
  11. $f = dirname(__FILE__)."/004.txt.gz";
  12. $f2 = "zlib_wrapper_ftruncate_basic.txt.gz";
  13. copy($f, $f2);
  14. $h = gzopen($f2, "r");
  15. ftruncate($h, 20);
  16. fclose($h);
  17. unlink($f2);
  18. $h = gzopen($f2, "w");
  19. ftruncate($h, 20);
  20. fclose($h);
  21. unlink($f2);
  22. ?>
  23. ===DONE===
  24. --EXPECTF--
  25. Warning: ftruncate(): Can't truncate this stream! in %s on line %d
  26. Warning: ftruncate(): Can't truncate this stream! in %s on line %d
  27. ===DONE===