Annotation of embedaddon/php/ext/zlib/tests/gzrewind_basic.phpt, revision 1.1.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: echo "test rewind before doing anything\n";
                     14: var_dump(gzrewind($h));
                     15: var_dump(gztell($h));
                     16: echo "\nfirst 30 characters=".gzread($h, 30)."\n";
                     17: var_dump(gztell($h));
                     18: gzrewind($h);
                     19: var_dump(gztell($h));
                     20: echo "first 10 characters=".gzread($h, 10)."\n";
                     21: gzrewind($h);
                     22: echo "first 20 characters=".gzread($h, 20)."\n";
                     23: gzclose($h);
                     24: ?>
                     25: ===DONE===
                     26: --EXPECT--
                     27: test rewind before doing anything
                     28: bool(true)
                     29: int(0)
                     30: 
                     31: first 30 characters=When you're taught through fee
                     32: int(30)
                     33: int(0)
                     34: first 10 characters=When you'r
                     35: first 20 characters=When you're taught t
                     36: ===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>