summaryrefslogtreecommitdiff
path: root/ext/zlib/tests/gzwrite_error2.phpt
diff options
context:
space:
mode:
authorDave Kelsey <dkelsey@php.net>2009-01-19 14:03:08 (GMT)
committerDave Kelsey <dkelsey@php.net>2009-01-19 14:03:08 (GMT)
commit8f9ec4238fa879ab7bc4adb5c42a222b929c3b60 (patch)
treea5c6e17e512963f68d6933ceebca218b55a26487 /ext/zlib/tests/gzwrite_error2.phpt
parent357ed77aeaeaf45885d372b061b67110fe04dc76 (diff)
downloadphp-8f9ec4238fa879ab7bc4adb5c42a222b929c3b60.tar.gz
new tests for zlib extension, tested on windows, linux and linux64
Diffstat (limited to 'ext/zlib/tests/gzwrite_error2.phpt')
-rw-r--r--ext/zlib/tests/gzwrite_error2.phpt30
1 files changed, 30 insertions, 0 deletions
diff --git a/ext/zlib/tests/gzwrite_error2.phpt b/ext/zlib/tests/gzwrite_error2.phpt
new file mode 100644
index 0000000..6912750
--- /dev/null
+++ b/ext/zlib/tests/gzwrite_error2.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Test function gzwrite() by calling it invalid lengths
+--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. ";
+var_dump(gzwrite( $h, $str, 0 ) );
+var_dump(gzwrite( $h, $str, -1 ) );
+gzclose($h);
+
+$h = gzopen($filename, 'r');
+gzpassthru($h);
+gzclose($h);
+echo "\n";
+unlink($filename);
+?>
+===DONE===
+--EXPECT--
+int(0)
+int(0)
+
+===DONE=== \ No newline at end of file