xref: /PHP-5.4/ext/zlib/tests/gzread_basic.phpt (revision 8f9ec423)
1--TEST--
2Test function gzread() 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 gzread is an alias to fread. parameter checking tests will be
12// the same as fread
13
14$f = dirname(__FILE__)."/004.txt.gz";
15$h = gzopen($f, 'r');
16$lengths = array(10, 14, 7, 99, 2000);
17
18foreach ($lengths as $length) {
19   var_dump(gzread( $h, $length ) );
20}
21gzclose($h);
22
23?>
24===DONE===
25--EXPECT--
26string(10) "When you'r"
27string(14) "e taught throu"
28string(7) "gh feel"
29string(99) "ings
30Destiny flying high above
31all I know is that you can realize it
32Destiny who cares
33as it turns "
34string(46) "around
35and I know that it descends down on me
36"
37===DONE===