Annotation of embedaddon/php/ext/standard/tests/dir/scandir_error2.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test scandir() function : error conditions - Non-existent directory
3: --FILE--
4: <?php
5: /* Prototype : array scandir(string $dir [, int $sorting_order [, resource $context]])
6: * Description: List files & directories inside the specified path
7: * Source code: ext/standard/dir.c
8: */
9:
10: /*
11: * Pass a directory that does not exist to scandir() to test error messages
12: */
13:
14: echo "*** Testing scandir() : error conditions ***\n";
15:
16: $directory = dirname(__FILE__) . '/idonotexist';
17:
18: echo "\n-- Pass scandir() an absolute path that does not exist --\n";
19: var_dump(scandir($directory));
20:
21: echo "\n-- Pass scandir() a relative path that does not exist --\n";
22: var_dump(scandir('/idonotexist'));
23: ?>
24: ===DONE===
25: --EXPECTF--
26: *** Testing scandir() : error conditions ***
27:
28: -- Pass scandir() an absolute path that does not exist --
29:
30: Warning: scandir(%s/idonotexist): failed to open dir: %s in %s on line %d
31:
32: Warning: scandir(): (errno %d): %s in %s on line %d
33: bool(false)
34:
35: -- Pass scandir() a relative path that does not exist --
36:
37: Warning: scandir(/idonotexist): failed to open dir: %s in %s on line %d
38:
39: Warning: scandir(): (errno %d): %s in %s on line %d
40: bool(false)
41: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>