Annotation of embedaddon/php/ext/zlib/tests/gzclose_basic.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test function gzclose() 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 gzclose is an alias to fclose. parameter checking tests will be
                     12: // the same as fclose
                     13: 
                     14: $f = dirname(__FILE__)."/004.txt.gz";
                     15: $h = gzopen($f, 'r');
                     16: gzread($h, 20);
                     17: var_dump(gzclose($h));
                     18: 
                     19: //should fail.
                     20: gzread($h, 20);
                     21: 
                     22: $h = gzopen($f, 'r');
                     23: gzread($h, 20);
                     24: var_dump(fclose($h));
                     25: 
                     26: //should fail.
                     27: gzread($h, 20);
                     28: 
                     29: 
                     30: ?>
                     31: ===DONE===
                     32: --EXPECTF--
                     33: bool(true)
                     34: 
                     35: Warning: gzread(): %d is not a valid stream resource in %s on line %d
                     36: bool(true)
                     37: 
                     38: Warning: gzread(): %d is not a valid stream resource in %s on line %d
                     39: ===DONE===

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