1--TEST--
2Test dir() function : usage variations - checking with wildcard characters
3--SKIPIF--
4<?php
5if (substr(PHP_OS, 0, 3) == 'WIN') {
6    die('skip.. Not valid for Windows');
7}
8?>
9--FILE--
10<?php
11/*
12 * Create more than one temporary directory & subdirectory and check if dir() function can open
13 * those directories when wildcard characters are used to refer to them.
14 */
15
16echo "*** Testing dir() : checking with wildcard characters ***\n";
17
18// create the temporary directories
19$file_path = __DIR__;
20$dir_path = $file_path."/dir_variation81";
21$sub_dir_path = $dir_path."/sub_dir1";
22
23@mkdir($dir_path1);
24@mkdir($sub_dir_path);
25
26/* with different wildcard characters */
27
28echo "-- wildcard = '*' --\n";
29var_dump( dir($file_path."/dir_var*") );
30var_dump( dir($file_path."/*") );
31
32echo "-- wildcard = '?' --\n";
33var_dump( dir($dir_path."/sub_dir?") );
34var_dump( dir($dir_path."/sub?dir1") );
35
36echo "Done";
37?>
38--EXPECTF--
39*** Testing dir() : checking with wildcard characters ***
40-- wildcard = '*' --
41
42Warning: dir(%s/dir_var*): Failed to open directory: %s in %s on line %d
43bool(false)
44
45Warning: dir(%s/*): Failed to open directory: %s in %s on line %d
46bool(false)
47-- wildcard = '?' --
48
49Warning: dir(%s/dir_variation81/sub_dir?): Failed to open directory: %s in %s on line %d
50bool(false)
51
52Warning: dir(%s/dir_variation81/sub?dir1): Failed to open directory: %s in %s on line %d
53bool(false)
54Done
55