summaryrefslogtreecommitdiff
path: root/ext/spl/tests/bug68825.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/spl/tests/bug68825.phpt')
-rw-r--r--ext/spl/tests/bug68825.phpt25
1 files changed, 25 insertions, 0 deletions
diff --git a/ext/spl/tests/bug68825.phpt b/ext/spl/tests/bug68825.phpt
new file mode 100644
index 0000000000..b1ed5fb60f
--- /dev/null
+++ b/ext/spl/tests/bug68825.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Bug #68825 (Exception in DirectoryIterator::getLinkTarget())
+--FILE--
+<?php
+$dir = __DIR__ . '/bug68825';
+mkdir($dir);
+symlink(__FILE__, "$dir/foo");
+
+$di = new \DirectoryIterator($dir);
+foreach ($di as $entry) {
+ if ('foo' === $entry->getFilename()) {
+ var_dump($entry->getLinkTarget());
+ }
+}
+?>
+===DONE===
+--EXPECTF--
+string(%d) "%s%eext%espl%etests%ebug68825.php"
+===DONE===
+--CLEAN--
+<?php
+$dir = __DIR__ . '/bug68825';
+unlink("$dir/foo");
+rmdir($dir);
+?>