Annotation of embedaddon/php/ext/standard/tests/file/windows_links/bug48746_2.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Bug#48746 - Junction not working properly
                      3: 
                      4: --CREDIT--
                      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: }
                     12: $ret = exec('mklink bug48746_tmp.lnk ' . __FILE__ .' 2>&1', $out);
                     13: if (strpos($ret, 'privilege')) {
                     14:        die('skip. SeCreateSymbolicLinkPrivilege not enable for this user.');
                     15: }
                     16: unlink('mklink bug48746_tmp.lnk');
                     17: ?>
                     18: --FILE--
                     19: <?php
                     20: $old_dir = __DIR__;
                     21: $dirname = __DIR__ . "\\mnt\\test\\directory";
                     22: exec("mkdir " . $dirname, $output, $ret_val);
                     23: chdir(__DIR__ . "\\mnt\\test");
                     24: $drive = substr(__DIR__, 0, 2);
                     25: $pathwithoutdrive = substr(__DIR__, 2);
                     26: $ret = exec("mountvol " . $drive . " /L", $output, $ret_val);
                     27: exec("mklink /j mounted_volume " . $ret, $output, $ret_val);
                     28: $fullpath = "mounted_volume" . $pathwithoutdrive;
                     29: exec("mklink /j mklink_junction directory", $output, $ret_val);
                     30: file_put_contents("mklink_junction\\a.php", "<?php echo \"I am included.\n\" ?>");
                     31: file_put_contents("$fullpath\\mnt\\test\\directory\\b.php", "<?php echo \"I am included.\n\" ?>");
                     32: print_r(scandir("mklink_junction"));
                     33: print_r(scandir("$fullpath\\mnt\\test\\directory"));
                     34: print_r(scandir("$fullpath\\mnt\\test\\mklink_junction"));
                     35: unlink("$fullpath\\mnt\\test\\directory\\b.php");
                     36: unlink("mklink_junction\\a.php");
                     37: chdir($old_dir);
                     38: rmdir(__DIR__ . "\\mnt\\test\\directory");
                     39: rmdir(__DIR__ . "\\mnt\\test\\mklink_junction");
                     40: rmdir(__DIR__ . "\\mnt\\test\\mounted_volume");
                     41: rmdir(__DIR__ . "\\mnt\\test");
                     42: rmdir(__DIR__ . "\\mnt");
                     43: 
                     44: ?>
                     45: --EXPECT--
                     46: Array
                     47: (
                     48:     [0] => .
                     49:     [1] => ..
                     50:     [2] => a.php
                     51:     [3] => b.php
                     52: )
                     53: Array
                     54: (
                     55:     [0] => .
                     56:     [1] => ..
                     57:     [2] => a.php
                     58:     [3] => b.php
                     59: )
                     60: Array
                     61: (
                     62:     [0] => .
                     63:     [1] => ..
                     64:     [2] => a.php
                     65:     [3] => b.php
                     66: )

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>