xref: /PHP-7.2/ext/spl/tests/bug68825.phpt (revision 32a728d3)
1--TEST--
2Bug #68825 (Exception in DirectoryIterator::getLinkTarget())
3--FILE--
4<?php
5$dir = __DIR__ . '/bug68825';
6mkdir($dir);
7symlink(__FILE__, "$dir/foo");
8
9$di = new \DirectoryIterator($dir);
10foreach ($di as $entry) {
11    if ('foo' === $entry->getFilename()) {
12        var_dump($entry->getLinkTarget());
13    }
14}
15?>
16===DONE===
17--EXPECTF--
18string(%d) "%s%eext%espl%etests%ebug68825.php"
19===DONE===
20--CLEAN--
21<?php
22$dir = __DIR__ . '/bug68825';
23unlink("$dir/foo");
24rmdir($dir);
25?>
26