diff --git a/core/tests/bootstrap.php b/core/tests/bootstrap.php index ab54353..c69a52f 100644 --- a/core/tests/bootstrap.php +++ b/core/tests/bootstrap.php @@ -18,14 +18,13 @@ */ function drupal_phpunit_find_extension_directories($scan_directory) { $extensions = array(); - $dir = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($scan_directory, \RecursiveDirectoryIterator::FOLLOW_SYMLINKS)); - foreach ($dir as $d) { - if (strpos($d->getPathname(), 'info.yml') !== FALSE) { + $dirs = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($scan_directory, \RecursiveDirectoryIterator::FOLLOW_SYMLINKS)); + foreach ($dirs as $dir) { + if (strpos($dir->getPathname(), 'info.yml') !== FALSE) { // Cut off ".info.yml" from the filename for use as the extension name. - $extensions[substr($d->getFilename(), 0, -9)] = $d->getPathInfo()->getRealPath(); + $extensions[substr($dir->getFilename(), 0, -9)] = $dir->getPathInfo()->getRealPath(); } } - return $extensions; }