]> granicus.if.org Git - php/commitdiff
Avoid concurrent directory writes in FilesystemIterator test
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 5 Jun 2019 07:58:59 +0000 (09:58 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Wed, 5 Jun 2019 07:58:59 +0000 (09:58 +0200)
The test directory is often used for temporary files, let's use
the source directory, which should be more stable. If that doesn't
work we need to create a temporary directory.

ext/spl/tests/dit_005.phpt

index 9278a115a3e2638d90bc434720980fa1e2f6d207..942a58d4ae64c15e013226bb2beb2bb6c969a579 100644 (file)
@@ -2,7 +2,8 @@
 SPL: FilesystemIterator and clone
 --FILE--
 <?php
-$a = new FileSystemIterator(__DIR__);
+// Let's hope nobody writes into this directory while testing...
+$a = new FileSystemIterator(__DIR__ . '/..');
 $b = clone $a;
 var_dump((string)$b == (string)$a);
 var_dump($a->key() == $b->key());