php-src/ext/zlib/tests/gzwrite_error2.phpt

30 lines
503 B
Plaintext
Raw Normal View History

--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===