Annotation of embedaddon/php/ext/zlib/tests/gzgets_basic.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test function gzgets() 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:
12: // note that gzgets is an alias to fgets. parameter checking tests will be
13: // the same as fgets
14:
15: $f = dirname(__FILE__)."/004.txt.gz";
16: $h = gzopen($f, 'r');
17: $lengths = array(10, 14, 7, 99);
18: foreach ($lengths as $length) {
19: var_dump(gzgets( $h, $length ) );
20: }
21:
22: while (gzeof($h) === false) {
23: var_dump(gzgets($h));
24: }
25: gzclose($h);
26:
27:
28: ?>
29: ===DONE===
30: --EXPECT--
31: string(9) "When you'"
32: string(13) "re taught thr"
33: string(6) "ough f"
34: string(8) "eelings
35: "
36: string(26) "Destiny flying high above
37: "
38: string(38) "all I know is that you can realize it
39: "
40: string(18) "Destiny who cares
41: "
42: string(19) "as it turns around
43: "
44: string(39) "and I know that it descends down on me
45: "
46: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>