diff options
Diffstat (limited to 'ext/zlib/tests/gzwrite_error2.phpt')
-rw-r--r-- | ext/zlib/tests/gzwrite_error2.phpt | 30 |
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 |