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.phpt12
1 files changed, 8 insertions, 4 deletions
diff --git a/ext/spl/tests/bug68825.phpt b/ext/spl/tests/bug68825.phpt
index b1ed5fb60f..e662503611 100644
--- a/ext/spl/tests/bug68825.phpt
+++ b/ext/spl/tests/bug68825.phpt
@@ -3,12 +3,16 @@ Bug #68825 (Exception in DirectoryIterator::getLinkTarget())
--FILE--
<?php
$dir = __DIR__ . '/bug68825';
-mkdir($dir);
-symlink(__FILE__, "$dir/foo");
+
+if (!mkdir($dir)) {
+ die('Failed to create temporary directory for testing');
+} else if (!symlink(__FILE__, $dir . '/bug')) {
+ die('Failed to create symbolic link');
+}
$di = new \DirectoryIterator($dir);
foreach ($di as $entry) {
- if ('foo' === $entry->getFilename()) {
+ if ('bug' === $entry->getFilename()) {
var_dump($entry->getLinkTarget());
}
}
@@ -20,6 +24,6 @@ string(%d) "%s%eext%espl%etests%ebug68825.php"
--CLEAN--
<?php
$dir = __DIR__ . '/bug68825';
-unlink("$dir/foo");
+unlink($dir . '/bug');
rmdir($dir);
?>