1--TEST--
2Bug#48746 - Junction not working properly
3
4--CREDITS--
5Venkat Raman Don (don.raman@microsoft.com)
6
7--SKIPIF--
8<?php
9if(substr(PHP_OS, 0, 3) != 'WIN' ) {
10	die('skip windows only test');
11}
12include_once __DIR__ . '/common.inc';
13$ret = exec(get_junction().' /? 2>&1', $out);
14if (strpos($out[0], 'recognized')) {
15	die('skip. junction.exe not found in PATH.');
16}
17
18?>
19--FILE--
20<?php
21include_once __DIR__ . '/common.inc';
22$old_dir = __DIR__;
23$dirname = __DIR__ . "\\mnt\\test\\directory";
24exec("mkdir " . $dirname, $output, $ret_val);
25chdir(__DIR__ . "\\mnt\\test");
26exec(get_junction()." junction directory", $output, $ret_val);
27file_put_contents("junction\\a.php", "<?php echo \"I am included.\n\" ?>");
28file_put_contents("junction\\b.php", "<?php echo \"I am included.\n\" ?>");
29include "junction/a.php";
30require_once "junction\\b.php";
31print_r(scandir("junction"));
32unlink("junction\\a.php");
33unlink("junction\\b.php");
34chdir($old_dir);
35rmdir(__DIR__ . "\\mnt\\test\\directory");
36rmdir(__DIR__ . "\\mnt\\test\\junction");
37rmdir(__DIR__ . "\\mnt\\test");
38rmdir(__DIR__ . "\\mnt");
39
40?>
41--EXPECT--
42I am included.
43I am included.
44Array
45(
46    [0] => .
47    [1] => ..
48    [2] => a.php
49    [3] => b.php
50)
51