1--TEST--
2Bug #73962 bug with symlink related to cyrillic directory
3--SKIPIF--
4<?php
5if(substr(PHP_OS, 0, 3) != 'WIN' ) {
6    die('skip windows only test');
7}
8include_once __DIR__ . '/common.inc';
9skipIfSeCreateSymbolicLinkPrivilegeIsDisabled(__FILE__);
10?>
11--FILE--
12<?php
13include_once __DIR__ . '/common.inc';
14$mountvol = get_mountvol();
15$old_dir = __DIR__;
16$dirname = '"' . __DIR__ . "\\mnt\\test\\новая папка" . '"';
17exec("mkdir " . $dirname, $output, $ret_val);
18chdir(__DIR__ . "\\mnt\\test");
19$drive = substr(__DIR__, 0, 2);
20$pathwithoutdrive = substr(__DIR__, 2);
21$ret = exec($mountvol . " " . $drive . " /L", $output, $ret_val);
22exec("mklink /d mounted_volume " . $ret, $output, $ret_val);
23$fullpath = "mounted_volume" . $pathwithoutdrive;
24exec("mklink /d mklink_symlink \"новая папка\"", $output, $ret_val);
25file_put_contents("mklink_symlink\\a.php", "<?php echo \"I am included.\n\" ?>");
26file_put_contents("$fullpath\\mnt\\test\\новая папка\\b.php", "<?php echo \"I am included.\n\" ?>");
27var_dump(scandir("mklink_symlink"));
28var_dump(scandir("$fullpath\\mnt\\test\\новая папка"));
29var_dump(scandir("$fullpath\\mnt\\test\\mklink_symlink"));
30var_dump(is_readable("$fullpath\\mnt\\test\\mklink_symlink\b.php"));
31unlink("$fullpath\\mnt\\test\\новая папка\\b.php");
32unlink("mklink_symlink\\a.php");
33chdir($old_dir);
34rmdir(__DIR__ . "\\mnt\\test\\новая папка");
35rmdir(__DIR__ . "\\mnt\\test\\mklink_symlink");
36rmdir(__DIR__ . "\\mnt\\test\\mounted_volume");
37rmdir(__DIR__ . "\\mnt\\test");
38rmdir(__DIR__ . "\\mnt");
39
40?>
41--EXPECT--
42array(4) {
43  [0]=>
44  string(1) "."
45  [1]=>
46  string(2) ".."
47  [2]=>
48  string(5) "a.php"
49  [3]=>
50  string(5) "b.php"
51}
52array(4) {
53  [0]=>
54  string(1) "."
55  [1]=>
56  string(2) ".."
57  [2]=>
58  string(5) "a.php"
59  [3]=>
60  string(5) "b.php"
61}
62array(4) {
63  [0]=>
64  string(1) "."
65  [1]=>
66  string(2) ".."
67  [2]=>
68  string(5) "a.php"
69  [3]=>
70  string(5) "b.php"
71}
72bool(true)
73