Annotation of embedaddon/php/ext/standard/tests/file/windows_links/bug48746_2.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
2: Bug#48746 - Junction not working properly
3:
1.1.1.2 ! misho 4: --CREDITS--
1.1 misho 5: Venkat Raman Don (don.raman@microsoft.com)
6:
7: --SKIPIF--
8: <?php
9: if(substr(PHP_OS, 0, 3) != 'WIN' ) {
10: die('skip windows only test');
11: }
1.1.1.2 ! misho 12: include_once __DIR__ . '/common.inc';
1.1 misho 13: $ret = exec('mklink bug48746_tmp.lnk ' . __FILE__ .' 2>&1', $out);
14: if (strpos($ret, 'privilege')) {
15: die('skip. SeCreateSymbolicLinkPrivilege not enable for this user.');
16: }
1.1.1.2 ! misho 17: unlink('bug48746_tmp.lnk');
1.1 misho 18: ?>
19: --FILE--
20: <?php
1.1.1.2 ! misho 21: include_once __DIR__ . '/common.inc';
! 22: $mountvol = get_mountvol();
1.1 misho 23: $old_dir = __DIR__;
24: $dirname = __DIR__ . "\\mnt\\test\\directory";
25: exec("mkdir " . $dirname, $output, $ret_val);
26: chdir(__DIR__ . "\\mnt\\test");
27: $drive = substr(__DIR__, 0, 2);
28: $pathwithoutdrive = substr(__DIR__, 2);
1.1.1.2 ! misho 29: $ret = exec($mountvol . " " . $drive . " /L", $output, $ret_val);
1.1 misho 30: exec("mklink /j mounted_volume " . $ret, $output, $ret_val);
31: $fullpath = "mounted_volume" . $pathwithoutdrive;
32: exec("mklink /j mklink_junction directory", $output, $ret_val);
33: file_put_contents("mklink_junction\\a.php", "<?php echo \"I am included.\n\" ?>");
34: file_put_contents("$fullpath\\mnt\\test\\directory\\b.php", "<?php echo \"I am included.\n\" ?>");
35: print_r(scandir("mklink_junction"));
36: print_r(scandir("$fullpath\\mnt\\test\\directory"));
37: print_r(scandir("$fullpath\\mnt\\test\\mklink_junction"));
38: unlink("$fullpath\\mnt\\test\\directory\\b.php");
39: unlink("mklink_junction\\a.php");
40: chdir($old_dir);
41: rmdir(__DIR__ . "\\mnt\\test\\directory");
42: rmdir(__DIR__ . "\\mnt\\test\\mklink_junction");
43: rmdir(__DIR__ . "\\mnt\\test\\mounted_volume");
44: rmdir(__DIR__ . "\\mnt\\test");
45: rmdir(__DIR__ . "\\mnt");
46:
47: ?>
48: --EXPECT--
49: Array
50: (
51: [0] => .
52: [1] => ..
53: [2] => a.php
54: [3] => b.php
55: )
56: Array
57: (
58: [0] => .
59: [1] => ..
60: [2] => a.php
61: [3] => b.php
62: )
63: Array
64: (
65: [0] => .
66: [1] => ..
67: [2] => a.php
68: [3] => b.php
1.1.1.2 ! misho 69: )
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>