summaryrefslogtreecommitdiff
path: root/ext/standard/tests/dir/dir_error.phpt
blob: 5bdf181b50795a534346a5d518f878e4cd8241d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--TEST--
Test dir() function : error conditions
--FILE--
<?php
/*
 * Prototype  : object dir(string $directory[, resource $context])
 * Description: Directory class with properties, handle and class and methods read, rewind and close
 * Source code: ext/standard/dir.c
 */

echo "*** Testing dir() : error conditions ***\n";

// Zero arguments
echo "\n-- Testing dir() function with zero arguments --";
var_dump( dir() );

// With one more than expected number of arguments
echo "\n-- Testing dir() function with one more than expected number of arguments --";
$extra_arg = 10;
var_dump( dir(getcwd(), "stream", $extra_arg) );

echo "Done";
?>
--EXPECTF--
*** Testing dir() : error conditions ***

-- Testing dir() function with zero arguments --
Warning: dir() expects at least 1 parameter, 0 given in %s on line %d
NULL

-- Testing dir() function with one more than expected number of arguments --
Warning: dir() expects at most 2 parameters, 3 given in %s on line %d
NULL
Done