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