Annotation of embedaddon/php/ext/zlib/tests/gzwrite_error.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test function gzwrite() by calling it more than or less than its expected arguments
! 3: --SKIPIF--
! 4: <?php
! 5: if (!extension_loaded("zlib")) {
! 6: print "skip - ZLIB extension not loaded";
! 7: }
! 8: ?>
! 9: --FILE--
! 10: <?php
! 11: $filename = "temp.txt.gz";
! 12: $h = gzopen($filename, 'w');
! 13: $str = "Here is the string to be written. ";
! 14: $length = 10;
! 15: $extra_arg = 'nothing';
! 16: var_dump(gzwrite($h, $str, $length, $extra_arg));
! 17: var_dump(gzwrite($h));
! 18: var_dump(gzwrite());
! 19:
! 20: gzclose($h);
! 21: unlink($filename);
! 22:
! 23: ?>
! 24: ===DONE===
! 25: --EXPECTF--
! 26:
! 27: Warning: gzwrite() expects at most 3 parameters, 4 given in %s on line %d
! 28: bool(false)
! 29:
! 30: Warning: gzwrite() expects at least 2 parameters, 1 given in %s on line %d
! 31: bool(false)
! 32:
! 33: Warning: gzwrite() expects at least 2 parameters, 0 given in %s on line %d
! 34: bool(false)
! 35: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>