1--TEST--
2Test opendir() function : usage variations - Different wildcards
3--SKIPIF--
4<?php
5if (substr(PHP_OS, 0, 3) != 'WIN') {
6  die("skip Valid only on Windows");
7}
8?>
9--FILE--
10<?php
11/*
12 * Pass paths containing wildcards to test if opendir() recognises them
13 */
14
15echo "*** Testing opendir() : usage variations ***\n";
16// create the temporary directories
17$file_path = __DIR__;
18$dir_path = $file_path . "/opendir_variation6";
19$sub_dir_path = $dir_path . "/sub_dir1";
20
21mkdir($dir_path);
22mkdir($sub_dir_path);
23
24// with different wildcard characters
25
26echo "\n-- Wildcard = '*' --\n";
27var_dump( opendir($file_path . "/opendir_var*") );
28var_dump( opendir($file_path . "/*") );
29
30echo "\n-- Wildcard = '?' --\n";
31var_dump( opendir($dir_path . "/sub_dir?") );
32var_dump( opendir($dir_path . "/sub?dir1") );
33
34?>
35--CLEAN--
36<?php
37$dir_path = __DIR__ . "/opendir_variation6";
38$sub_dir_path = $dir_path . "/sub_dir1";
39
40rmdir($sub_dir_path);
41rmdir($dir_path);
42?>
43--EXPECTF--
44*** Testing opendir() : usage variations ***
45
46-- Wildcard = '*' --
47
48Warning: opendir(%s/opendir_var*): %s in %s on line %d
49
50Warning: opendir(%s/opendir_var*): Failed to open directory: %s in %s on line %d
51bool(false)
52
53Warning: opendir(%s/*): %s in %s on line %d
54
55Warning: opendir(%s/*): Failed to open directory: %s in %s on line %d
56bool(false)
57
58-- Wildcard = '?' --
59
60Warning: opendir(%s/opendir_variation6/sub_dir?): %s in %s on line %d
61
62Warning: opendir(%s/opendir_variation6/sub_dir?): Failed to open directory: %s in %s on line %d
63bool(false)
64
65Warning: opendir(%s/opendir_variation6/sub?dir1): %s in %s on line %d
66
67Warning: opendir(%s/opendir_variation6/sub?dir1): Failed to open directory: %s in %s on line %d
68bool(false)
69