Annotation of embedaddon/php/ext/zlib/tests/gzeof_basic.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test function feof() 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: // note that gzeof is an alias to gzeof. parameter checking tests will be
! 12: // the same as gzeof
! 13:
! 14: $f = dirname(__FILE__)."/004.txt.gz";
! 15:
! 16: echo "-- test 1 --\n";
! 17: $h = gzopen($f, 'r');
! 18: var_dump(gzeof($h));
! 19: gzpassthru($h);
! 20: var_dump(gzeof($h));
! 21: gzclose($h);
! 22:
! 23: echo "\n-- test 2 --\n";
! 24: $h = gzopen($f, 'r');
! 25: echo "reading 50 characters. eof should be false\n";
! 26: gzread($h, 50)."\n";
! 27: var_dump(gzeof($h));
! 28: echo "reading 250 characters. eof should be true\n";
! 29: gzread($h, 250)."\n";
! 30: var_dump(gzeof($h));
! 31: echo "reading 20 characters. eof should be true still\n";
! 32: gzread($h, 20)."\n";
! 33: var_dump(gzeof($h));
! 34: gzclose($h);
! 35:
! 36:
! 37:
! 38: ?>
! 39: ===DONE===
! 40: --EXPECT--
! 41: -- test 1 --
! 42: bool(false)
! 43: When you're taught through feelings
! 44: Destiny flying high above
! 45: all I know is that you can realize it
! 46: Destiny who cares
! 47: as it turns around
! 48: and I know that it descends down on me
! 49: bool(true)
! 50:
! 51: -- test 2 --
! 52: reading 50 characters. eof should be false
! 53: bool(false)
! 54: reading 250 characters. eof should be true
! 55: bool(true)
! 56: reading 20 characters. eof should be true still
! 57: bool(true)
! 58: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>