1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/spl/tests/bug68825.phpt
Christoph M. Becker 66a5f9fb18 Merge branch 'PHP-7.4'
* PHP-7.4:
  Extract test helper function for SeCreateSymbolicLinkPrivilege check
2020-07-02 12:24:49 +02:00

35 lines
794 B
PHP

--TEST--
Bug #68825 (Exception in DirectoryIterator::getLinkTarget())
--SKIPIF--
<?php
if (PHP_OS_FAMILY === 'Windows') {
include_once __DIR__ . '/../../standard/tests/file/windows_links/common.inc';
skipIfSeCreateSymbolicLinkPrivilegeIsDisabled(__FILE__);
}
?>
--FILE--
<?php
$dir = __DIR__ . '/bug68825';
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 ('bug' === $entry->getFilename()) {
var_dump($entry->getLinkTarget());
}
}
?>
--EXPECTF--
string(%d) "%s%eext%espl%etests%ebug68825.php"
--CLEAN--
<?php
$dir = __DIR__ . '/bug68825';
unlink($dir . '/bug');
rmdir($dir);
?>