scandir_error1.phpt [plain text]
--TEST--
Test scandir() function : error conditions - Incorrect number of args
--FILE--
<?php
echo "*** Testing scandir() : error conditions ***\n";
echo "\n-- Testing scandir() function with Zero arguments --\n";
var_dump( scandir() );
echo "\n-- Testing scandir() function with more than expected no. of arguments --\n";
$dir = dirname(__FILE__) . '/scandir_error';
mkdir($dir);
$sorting_order = 10;
$context = stream_context_create();
$extra_arg = 10;
var_dump( scandir($dir, $sorting_order, $context, $extra_arg) );
?>
===DONE===
--CLEAN--
<?php
$directory = dirname(__FILE__) . '/scandir_error';
rmdir($directory);
?>
--EXPECTF--
*** Testing scandir() : error conditions ***
-- Testing scandir() function with Zero arguments --
Warning: scandir() expects at least 1 parameter, 0 given in %s on line %d
NULL
-- Testing scandir() function with more than expected no. of arguments --
Warning: scandir() expects at most 3 parameters, 4 given in %s on line %d
NULL
===DONE===