]> granicus.if.org Git - php/commitdiff
- skip if not enough permission and add to trunk
authorPierre Joye <pajoye@php.net>
Wed, 27 Jan 2010 23:54:52 +0000 (23:54 +0000)
committerPierre Joye <pajoye@php.net>
Wed, 27 Jan 2010 23:54:52 +0000 (23:54 +0000)
ext/standard/tests/file/bug47767.phpt [new file with mode: 0644]

diff --git a/ext/standard/tests/file/bug47767.phpt b/ext/standard/tests/file/bug47767.phpt
new file mode 100644 (file)
index 0000000..7aec433
--- /dev/null
@@ -0,0 +1,50 @@
+--TEST--\r
+bug #47767 (include_once does not resolve windows symlinks or junctions)\r
+--CREDITS--\r
+Venkat Raman Don\r
+--SKIPIF--\r
+<?php\r
+if(substr(PHP_OS, 0, 3) != 'WIN' ) {\r
+               die('skip windows only test');\r
+}\r
+if(PHP_WINDOWS_VERSION_MAJOR < 6)  {\r
+        die('skip windows version 6.0+ only test');\r
+}\r
+\r
+$ret = exec('mklink rename_variation13tmp.lnk ' . __FILE__ .' 2>&1', $out);\r
+if (strpos($ret, 'privilege')) {\r
+       die('skip. SeCreateSymbolicLinkPrivilege not enable for this user.');\r
+}\r
+?>\r
+--FILE--\r
+<?php\r
+echo "Testing include_once using file symbolic link\n";\r
+$filename = __DIR__ . '\\a.php';\r
+$content = '<?php echo "I am included\n" ?>';\r
+file_put_contents($filename, $content);\r
+$softlinkname = __DIR__ . '\\a_slink.php';\r
+symlink($filename, $softlinkname);\r
+include_once("$filename");\r
+include_once("$softlinkname");\r
+include_once("$softlinkname");\r
+\r
+echo "Testing include_once using directory symbolic link\n";\r
+$softdirlinkname = __DIR__ . "\\a_dir";\r
+symlink(__DIR__, $softdirlinkname);\r
+include_once("$softdirlinkname" . '\\a.php');\r
+\r
+echo "Testing include_once using junction points\n";\r
+$junctionname = __DIR__ . '\\a_jdir';\r
+exec("mklink /J $junctionname " . __DIR__);\r
+include_once("$junctionname" . '\\a.php');\r
+\r
+unlink($filename);\r
+unlink($softlinkname);\r
+rmdir($softdirlinkname);\r
+rmdir($junctionname);\r
+?>\r
+--EXPECT--\r
+Testing include_once using file symbolic link\r
+I am included\r
+Testing include_once using directory symbolic link\r
+Testing include_once using junction points
\ No newline at end of file