xref: /PHP-5.4/ext/zlib/tests/gzclose_basic.phpt (revision 8f9ec423)
1--TEST--
2Test function gzclose() by calling it with its expected arguments
3--SKIPIF--
4<?php
5if (!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');
16gzread($h, 20);
17var_dump(gzclose($h));
18
19//should fail.
20gzread($h, 20);
21
22$h = gzopen($f, 'r');
23gzread($h, 20);
24var_dump(fclose($h));
25
26//should fail.
27gzread($h, 20);
28
29
30?>
31===DONE===
32--EXPECTF--
33bool(true)
34
35Warning: gzread(): %d is not a valid stream resource in %s on line %d
36bool(true)
37
38Warning: gzread(): %d is not a valid stream resource in %s on line %d
39===DONE===
40