You are here

public function FinderTest::testMultipleLocations in Database Sanitize 7

Searching in multiple locations involves AppendIterator which does an unnecessary rewind which leaves FilterIterator with inner FilesystemIterator in an invalid state.

See also

https://bugs.php.net/68557

File

vendor/symfony/finder/Tests/FinderTest.php, line 520

Class

FinderTest

Namespace

Symfony\Component\Finder\Tests

Code

public function testMultipleLocations() {
  $locations = array(
    self::$tmpDir . '/',
    self::$tmpDir . '/toto/',
  );

  // it is expected that there are test.py test.php in the tmpDir
  $finder = new Finder();
  $finder
    ->in($locations)
    ->ignoreDotFiles(false)
    ->depth('< 1')
    ->name('test.php');
  $this
    ->assertCount(1, $finder);
}