summaryrefslogtreecommitdiff
path: root/ext/zlib/tests/gzwrite_basic.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/zlib/tests/gzwrite_basic.phpt')
-rw-r--r--ext/zlib/tests/gzwrite_basic.phpt31
1 files changed, 31 insertions, 0 deletions
diff --git a/ext/zlib/tests/gzwrite_basic.phpt b/ext/zlib/tests/gzwrite_basic.phpt
new file mode 100644
index 0000000..0d75216
--- /dev/null
+++ b/ext/zlib/tests/gzwrite_basic.phpt
@@ -0,0 +1,31 @@
+--TEST--
+Test function gzwrite() by calling it with its expected arguments
+--SKIPIF--
+<?php
+if (!extension_loaded("zlib")) {
+ print "skip - ZLIB extension not loaded";
+}
+?>
+--FILE--
+<?php
+
+$filename = "temp.txt.gz";
+$h = gzopen($filename, 'w');
+$str = "Here is the string to be written. ";
+$length = 10;
+var_dump(gzwrite( $h, $str ) );
+var_dump(gzwrite( $h, $str, $length ) );
+gzclose($h);
+
+$h = gzopen($filename, 'r');
+gzpassthru($h);
+gzclose($h);
+echo "\n";
+unlink($filename);
+?>
+===DONE===
+--EXPECT--
+int(34)
+int(10)
+Here is the string to be written. Here is th
+===DONE=== \ No newline at end of file