get_headers_error_001.phpt [plain text]
--TEST--
Test get_headers() function : error conditions - wrong number of args
--CREDITS--
June Henriksen <juneih@redpill-linpro.com>
#PHPTestFest2009 Norway 2009-06-09 \o/
--FILE--
<?php
echo "*** Testing get_headers() : error conditions ***\n";
echo "\n-- Testing get_headers() function with Zero arguments --\n";
var_dump( get_headers() );
echo "\n-- Testing get_headers() function with more than expected no. of arguments --\n";
$url = 'string_val';
$format = 1;
$extra_arg = 10;
var_dump( get_headers($url, $format, $extra_arg) );
echo "Done";
?>
--EXPECTF--
*** Testing get_headers() : error conditions ***
-- Testing get_headers() function with Zero arguments --
Warning: get_headers() expects at least 1 parameter, 0 given in %s on line 12
NULL
-- Testing get_headers() function with more than expected no. of arguments --
Warning: get_headers() expects at most 2 parameters, 3 given in %s on line 19
NULL
Done