xref: /PHP-7.0/ext/zlib/tests/gzputs_basic.phpt (revision 9c1e1bbc)
1--TEST--
2Test function gzputs() 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
12$filename = dirname(__FILE__)."/gzputs_basic.txt.gz";
13$h = gzopen($filename, 'w');
14$str = "Here is the string to be written. ";
15$length = 10;
16var_dump(gzputs( $h, $str ) );
17var_dump(gzputs( $h, $str, $length ) );
18gzclose($h);
19
20$h = gzopen($filename, 'r');
21gzpassthru($h);
22gzclose($h);
23echo "\n";
24unlink($filename);
25?>
26===DONE===
27--EXPECT--
28int(34)
29int(10)
30Here is the string to be written. Here is th
31===DONE===