Annotation of embedaddon/php/ext/standard/tests/dir/scandir_variation6-win32.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test scandir() function : usage variations - Wildcards in directory path
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 path using wildcards as $dir argument to test how scandir() behaves
18: */
19:
20: echo "*** Testing scandir() : usage variations ***\n";
21:
22: // create the temporary directories
23: $file_path = dirname(__FILE__);
24: $dir_path = $file_path . "/scandir_variation6";
25: $sub_dir_path = $dir_path . "/sub_dir1";
26:
27: mkdir($dir_path);
28: mkdir($sub_dir_path);
29:
30: // with different wildcard characters
31:
32: echo "\n-- Wildcard = '*' --\n";
33: var_dump( scandir($file_path . "/scandir_var*") );
34: var_dump( scandir($file_path . "/*") );
35:
36: echo "\n-- Wildcard = '?' --\n";
37: var_dump( scandir($dir_path . "/sub_dir?") );
38: var_dump( scandir($dir_path . "/sub?dir1") );
39:
40: ?>
41: ===DONE===
42: --CLEAN--
43: <?php
44: $dir_path = dirname(__FILE__) . "/scandir_variation6";
45: $sub_dir_path = $dir_path . "/sub_dir1";
46:
47: rmdir($sub_dir_path);
48: rmdir($dir_path);
49: ?>
50: --EXPECTF--
51: *** Testing scandir() : usage variations ***
52:
53: -- Wildcard = '*' --
54:
55: Warning: scandir(%s/scandir_var*,%s/scandir_var*): No such file or directory in %s on line %d
56:
57: Warning: scandir(%s/scandir_var*): failed to open dir: No such file or directory in %sscandir_variation6-win32.php on line %d
58:
59: Warning: scandir(): (errno %d): %s in %s on line %d
60: bool(false)
61:
62: Warning: scandir(%s/*,%s/*): No such file or directory in %s on line %d
63:
64: Warning: scandir(%s/*): failed to open dir: No such file or directory in %sscandir_variation6-win32.php on line %d
65:
66: Warning: scandir(): (errno %d): %s in %s on line %d
67: bool(false)
68:
69: -- Wildcard = '?' --
70:
71: Warning: scandir(%s/scandir_variation6/sub_dir?,%s/scandir_variation6/sub_dir?): No such file or directory in %s on line %d
72:
73: Warning: scandir(%s/scandir_variation6/sub_dir?): failed to open dir: No such file or directory in %sscandir_variation6-win32.php on line %d
74:
75: Warning: scandir(): (errno %d): %s in %s on line %d
76: bool(false)
77:
78: Warning: scandir(%s/scandir_variation6/sub?dir1,%s/scandir_variation6/sub?dir1): No such file or directory in %s on line %d
79:
80: Warning: scandir(%s/scandir_variation6/sub?dir1): failed to open dir: No such file or directory in %sscandir_variation6-win32.php on line %d
81:
82: Warning: scandir(): (errno %d): %s in %s on line %d
83: bool(false)
84: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>