summaryrefslogtreecommitdiff
path: root/ext/spl/tests/spl_fileinfo_getlinktarget_basic.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/spl/tests/spl_fileinfo_getlinktarget_basic.phpt')
-rwxr-xr-xext/spl/tests/spl_fileinfo_getlinktarget_basic.phpt22
1 files changed, 22 insertions, 0 deletions
diff --git a/ext/spl/tests/spl_fileinfo_getlinktarget_basic.phpt b/ext/spl/tests/spl_fileinfo_getlinktarget_basic.phpt
new file mode 100755
index 0000000000..399d9a31aa
--- /dev/null
+++ b/ext/spl/tests/spl_fileinfo_getlinktarget_basic.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SPL: Spl File Info test getLinkTarget
+--CREDITS--
+Nataniel McHugh nat@fishtrap.co.uk
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') die("skip this test not for Windows platforms");
+?>
+--FILE--
+<?php
+$link = 'test_link';
+symlink(__FILE__, $link );
+$fileInfo = new SplFileInfo($link);
+
+if ($fileInfo->isLink()) {
+ echo $fileInfo->getLinkTarget() == __FILE__ ? 'same' : 'different',PHP_EOL;
+}
+var_dump(unlink($link));
+?>
+--EXPECT--
+same
+bool(true)