vprintf_error.phpt [plain text]
--TEST--
Test vprintf() function : error conditions
--FILE--
<?php
echo "*** Testing vprintf() : error conditions ***\n";
$format = "%s";
$args = array("hello");
$extra_arg = "extra arg";
echo "\n-- Testing vprintf() function with Zero arguments --\n";
var_dump( vprintf() );
echo "\n-- Testing vprintf() function with less than expected no. of arguments --\n";
var_dump( vprintf($format) );
echo "\n-- testing vprintf() function with more than expected no. of arguments --\n";
var_dump( vprintf($format, $args, $extra_arg) );
?>
===DONE===
--EXPECTF--
*** Testing vprintf() : error conditions ***
-- Testing vprintf() function with Zero arguments --
Warning: vprintf() expects at least 1 parameter, 0 given in %s on line %d
bool(false)
-- Testing vprintf() function with less than expected no. of arguments --
Warning: Wrong parameter count for vprintf() in %s on line %d
bool(false)
-- testing vprintf() function with more than expected no. of arguments --
Warning: Wrong parameter count for vprintf() in %s on line %d
bool(false)
===DONE===