diff options
Diffstat (limited to 'ext/spl/tests/spl_fileinfo_getlinktarget_basic.phpt')
-rwxr-xr-x | ext/spl/tests/spl_fileinfo_getlinktarget_basic.phpt | 22 |
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) |