Annotation of embedaddon/php/ext/standard/tests/file/windows_links/bug48746.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';
        !            13: $cmd = "mklink /?";
1.1       misho      14: $ret = @exec($cmd, $output, $return_val);
                     15: if (count($output) == 0) {
                     16:     die("mklink.exe not found in PATH");
                     17: }
                     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: mkdir($dirname, 0700, true);
                     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: var_dump(file_exists("directory"));
                     34: var_dump(file_exists("mklink_junction"));
                     35: var_dump(file_exists("mounted_volume"));
                     36: var_dump(file_exists("$fullpath"));
                     37: var_dump(is_dir("mklink_junction"));
                     38: var_dump(is_dir("$fullpath"));
                     39: var_dump(is_readable("mklink_junction"));
                     40: var_dump(is_writeable("$fullpath"));
                     41: chdir($old_dir);
                     42: 
                     43: rmdir(__DIR__ . "\\mnt\\test\\directory");
                     44: rmdir(__DIR__ . "\\mnt\\test\\mklink_junction");
                     45: rmdir(__DIR__ . "\\mnt\\test\\mounted_volume");
                     46: rmdir(__DIR__ . "\\mnt\\test");
                     47: rmdir(__DIR__ . "\\mnt");
                     48: 
                     49: ?>
                     50: --EXPECT--
                     51: bool(true)
                     52: bool(true)
                     53: bool(true)
                     54: bool(true)
                     55: bool(true)
                     56: bool(true)
                     57: bool(true)
                     58: bool(true)

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