Annotation of embedaddon/php/ext/standard/tests/dir/dir_error.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test dir() function : error conditions
3: --FILE--
4: <?php
5: /*
6: * Prototype : object dir(string $directory[, resource $context])
7: * Description: Directory class with properties, handle and class and methods read, rewind and close
8: * Source code: ext/standard/dir.c
9: */
10:
11: echo "*** Testing dir() : error conditions ***\n";
12:
13: // Zero arguments
14: echo "\n-- Testing dir() function with zero arguments --";
15: var_dump( dir() );
16:
17: // With one more than expected number of arguments
18: echo "\n-- Testing dir() function with one more than expected number of arguments --";
19: $extra_arg = 10;
20: var_dump( dir(getcwd(), "stream", $extra_arg) );
21:
22: echo "Done";
23: ?>
24: --EXPECTF--
25: *** Testing dir() : error conditions ***
26:
27: -- Testing dir() function with zero arguments --
28: Warning: dir() expects at least 1 parameter, 0 given in %s on line %d
29: NULL
30:
31: -- Testing dir() function with one more than expected number of arguments --
32: Warning: dir() expects at most 2 parameters, 3 given in %s on line %d
33: NULL
34: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>