You are here

public function FinderTest::testMultipleLocationsWithSubDirectories in Database Sanitize 7

Searching in multiple locations with sub directories 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 545

Class

FinderTest

Namespace

Symfony\Component\Finder\Tests

Code

public function testMultipleLocationsWithSubDirectories() {
  $locations = array(
    __DIR__ . '/Fixtures/one',
    self::$tmpDir . \DIRECTORY_SEPARATOR . 'toto',
  );
  $finder = $this
    ->buildFinder();
  $finder
    ->in($locations)
    ->depth('< 10')
    ->name('*.neon');
  $expected = array(
    __DIR__ . '/Fixtures/one' . \DIRECTORY_SEPARATOR . 'b' . \DIRECTORY_SEPARATOR . 'c.neon',
    __DIR__ . '/Fixtures/one' . \DIRECTORY_SEPARATOR . 'b' . \DIRECTORY_SEPARATOR . 'd.neon',
  );
  $this
    ->assertIterator($expected, $finder);
  $this
    ->assertIteratorInForeach($expected, $finder);
}