mirror of
https://github.com/php/php-src.git
synced 2025-08-21 01:45:16 +02:00
Make ext/spl/tests/bug42364.phpt more robust
If tests are run in parallel, files may be created and deleted in the directory. Create a separate directory just for this test to avoid this dependence.
This commit is contained in:
parent
12edc453e5
commit
f5872614d8
1 changed files with 6 additions and 2 deletions
|
@ -2,10 +2,12 @@
|
|||
Bug #42364 (Crash when using getRealPath with DirectoryIterator)
|
||||
--FILE--
|
||||
<?php
|
||||
$it = new DirectoryIterator(dirname(__FILE__));
|
||||
$dir = __DIR__ . '/bug42364';
|
||||
@mkdir($dir);
|
||||
touch($dir . '/test');
|
||||
|
||||
$count = 0;
|
||||
|
||||
$it = new DirectoryIterator($dir);
|
||||
foreach ($it as $e) {
|
||||
$count++;
|
||||
$type = gettype($e->getRealPath());
|
||||
|
@ -19,6 +21,8 @@ if ($count > 0) {
|
|||
}
|
||||
?>
|
||||
===DONE===
|
||||
--CLEAN--
|
||||
<?php rmdir(__DIR__ . '/bug42364'); ?>
|
||||
--EXPECTF--
|
||||
Found %i entries!
|
||||
===DONE===
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue