Annotation of embedaddon/php/ext/zlib/tests/zlib_wrapper_ftruncate_basic.phpt, revision 1.1.1.2
1.1 misho 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";
1.1.1.2 ! misho 12: $f2 = "zlib_wrapper_ftruncate_basic.txt.gz";
1.1 misho 13: copy($f, $f2);
14:
15: $h = gzopen($f2, "r");
16: ftruncate($h, 20);
17: fclose($h);
18: unlink($f2);
19:
20: $h = gzopen($f2, "w");
21: ftruncate($h, 20);
22: fclose($h);
23: unlink($f2);
24:
25: ?>
26: ===DONE===
27: --EXPECTF--
28:
29: Warning: ftruncate(): Can't truncate this stream! in %s on line %d
30:
31: Warning: ftruncate(): Can't truncate this stream! in %s on line %d
32: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>