From: Pierre Joye Date: Sat, 5 Sep 2009 18:10:31 +0000 (+0000) Subject: - add test for #48746 X-Git-Tag: php-5.4.0alpha1~191^2~2692 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a733fe252181968dfedcaf372cc4ff239dc99278;p=php - add test for #48746 --- diff --git a/ext/standard/tests/file/windows_links/bug48746.phpt b/ext/standard/tests/file/windows_links/bug48746.phpt new file mode 100644 index 0000000000..4f8f110a22 --- /dev/null +++ b/ext/standard/tests/file/windows_links/bug48746.phpt @@ -0,0 +1,54 @@ +--TEST-- +Bug#48746 - Junction not working properly + +--CREDIT-- +Venkat Raman Don (don.raman@microsoft.com) + +--SKIPIF-- + +--FILE-- + +--EXPECT-- +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) \ No newline at end of file diff --git a/ext/standard/tests/file/windows_links/bug48746_1.phpt b/ext/standard/tests/file/windows_links/bug48746_1.phpt new file mode 100644 index 0000000000..32cb192c98 --- /dev/null +++ b/ext/standard/tests/file/windows_links/bug48746_1.phpt @@ -0,0 +1,56 @@ +--TEST-- +Bug#48746 - Junction not working properly + +--CREDIT-- +Venkat Raman Don (don.raman@microsoft.com) + +--SKIPIF-- + +--FILE-- +"); +include_once "mklink_junction\\a.php"; +file_put_contents("$fullpath\\mnt\\test\\directory\\b.php", ""); +require "$fullpath\\mnt\\test\\directory\\b.php"; +file_put_contents("$fullpath\\mnt\\test\\mklink_junction\\c.php", ""); +require_once "$fullpath\\mnt\\test\\mklink_junction\\c.php"; +var_dump(is_file("mklink_junction\\a.php")); +var_dump(is_file("$fullpath\\mnt\\test\\directory\\b.php")); +var_dump(is_file("$fullpath\\mnt\\test\\mklink_junction\\c.php")); +unlink("$fullpath\\mnt\\test\\directory\\b.php"); +unlink("$fullpath\\mnt\\test\\mklink_junction\\c.php"); +unlink("mklink_junction\\a.php"); +chdir($old_dir); +rmdir(__DIR__ . "\\mnt\\test\\directory"); +rmdir(__DIR__ . "\\mnt\\test\\mklink_junction"); +rmdir(__DIR__ . "\\mnt\\test\\mounted_volume"); +rmdir(__DIR__ . "\\mnt\\test"); +rmdir(__DIR__ . "\\mnt"); + +?> +--EXPECT-- +I am included. +I am included. +I am included. +bool(true) +bool(true) +bool(true) \ No newline at end of file diff --git a/ext/standard/tests/file/windows_links/bug48746_2.phpt b/ext/standard/tests/file/windows_links/bug48746_2.phpt new file mode 100644 index 0000000000..6c5c4fc093 --- /dev/null +++ b/ext/standard/tests/file/windows_links/bug48746_2.phpt @@ -0,0 +1,66 @@ +--TEST-- +Bug#48746 - Junction not working properly + +--CREDIT-- +Venkat Raman Don (don.raman@microsoft.com) + +--SKIPIF-- + +--FILE-- +"); +file_put_contents("$fullpath\\mnt\\test\\directory\\b.php", ""); +print_r(scandir("mklink_junction")); +print_r(scandir("$fullpath\\mnt\\test\\directory")); +print_r(scandir("$fullpath\\mnt\\test\\mklink_junction")); +unlink("$fullpath\\mnt\\test\\directory\\b.php"); +unlink("mklink_junction\\a.php"); +chdir($old_dir); +rmdir(__DIR__ . "\\mnt\\test\\directory"); +rmdir(__DIR__ . "\\mnt\\test\\mklink_junction"); +rmdir(__DIR__ . "\\mnt\\test\\mounted_volume"); +rmdir(__DIR__ . "\\mnt\\test"); +rmdir(__DIR__ . "\\mnt"); + +?> +--EXPECT-- +Array +( + [0] => . + [1] => .. + [2] => a.php + [3] => b.php +) +Array +( + [0] => . + [1] => .. + [2] => a.php + [3] => b.php +) +Array +( + [0] => . + [1] => .. + [2] => a.php + [3] => b.php +) \ No newline at end of file diff --git a/ext/standard/tests/file/windows_links/bug48746_3.phpt b/ext/standard/tests/file/windows_links/bug48746_3.phpt new file mode 100644 index 0000000000..ee8caa6ecf --- /dev/null +++ b/ext/standard/tests/file/windows_links/bug48746_3.phpt @@ -0,0 +1,48 @@ +--TEST-- +Bug#48746 - Junction not working properly + +--CREDIT-- +Venkat Raman Don (don.raman@microsoft.com) + +--SKIPIF-- + +--FILE-- +"); +file_put_contents("junction\\b.php", ""); +include "junction/a.php"; +require_once "junction\\b.php"; +print_r(scandir("junction")); +unlink("junction\\a.php"); +unlink("junction\\b.php"); +chdir($old_dir); +rmdir(__DIR__ . "\\mnt\\test\\directory"); +rmdir(__DIR__ . "\\mnt\\test\\junction"); +rmdir(__DIR__ . "\\mnt\\test"); +rmdir(__DIR__ . "\\mnt"); + +?> +--EXPECT-- +I am included. +I am included. +Array +( + [0] => . + [1] => .. + [2] => a.php + [3] => b.php +) \ No newline at end of file