1--TEST--
2Test opendir() function : basic functionality
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 * Test basic functionality of opendir() with absolute and relative paths as $path argument
13 */
14
15echo "*** Testing opendir() : basic functionality ***\n";
16
17$base_dir_path = __DIR__ . '/opendir_basic-win32-mb';
18@mkdir($base_dir_path);
19
20$level_one_dir_name = "私はガラスを食べられますlevel_one";
21$level_one_dir_path = "$base_dir_path/$level_one_dir_name";
22
23$level_two_dir_name = "私はガラスを食べられますlevel_two";
24$level_two_dir_path = "$base_dir_path/$level_one_dir_name/$level_two_dir_name";
25
26// create temporary directories - will remove in CLEAN section
27mkdir($level_one_dir_path);
28mkdir($level_two_dir_path);
29
30echo "\n-- Testing opendir() with absolute path: --\n";
31var_dump($dh1 = opendir($level_one_dir_path));
32
33
34echo "\n-- Testing opendir() with relative paths: --\n";
35var_dump(chdir($level_one_dir_path));
36var_dump($dh2 = opendir($level_two_dir_name));
37
38echo "\n-- Close directory handles: --\n";
39closedir($dh1);
40var_dump($dh1);
41closedir($dh2);
42var_dump($dh2);
43?>
44--CLEAN--
45<?php
46$base_dir_path = __DIR__ . '/opendir_basic-win32-mb';
47rmdir("$base_dir_path/私はガラスを食べられますlevel_one/私はガラスを食べられますlevel_two");
48rmdir("$base_dir_path/私はガラスを食べられますlevel_one");
49rmdir($base_dir_path);
50?>
51--EXPECTF--
52*** Testing opendir() : basic functionality ***
53
54-- Testing opendir() with absolute path: --
55resource(%d) of type (stream)
56
57-- Testing opendir() with relative paths: --
58bool(true)
59resource(%d) of type (stream)
60
61-- Close directory handles: --
62resource(%d) of type (Unknown)
63resource(%d) of type (Unknown)
64