Annotation of embedaddon/php/ext/zlib/tests/gzrewind_basic2.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test function gzrewind() by calling it with its expected arguments when reading
! 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: $h = gzopen($f, 'r');
! 13:
! 14: // read to the end of the file
! 15: echo "read to the end of the file, then rewind\n";
! 16: gzread($h, 10000);
! 17: var_dump(gzeof($h));
! 18: var_dump(gztell($h));
! 19: gzrewind($h);
! 20: var_dump(gzeof($h));
! 21: var_dump(gztell($h));
! 22: echo "first 20 characters=".gzread($h,20)."\n";
! 23:
! 24: gzclose($h);
! 25: ?>
! 26: ===DONE===
! 27: --EXPECT--
! 28: read to the end of the file, then rewind
! 29: bool(true)
! 30: int(176)
! 31: bool(false)
! 32: int(0)
! 33: first 20 characters=When you're taught t
! 34: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>