You are here

public function vfsStreamContainerIteratorTestCase::iteration in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamContainerIteratorTestCase.php \org\bovigo\vfs\vfsStreamContainerIteratorTestCase::iteration()

@test @dataProvider provideSwitchWithExpectations

Parameters

\Closure $dotFilesSwitch:

array $dirNames:

File

vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamContainerIteratorTestCase.php, line 91

Class

vfsStreamContainerIteratorTestCase
Test for org\bovigo\vfs\vfsStreamContainerIterator.

Namespace

org\bovigo\vfs

Code

public function iteration(\Closure $dotFilesSwitch, array $dirs) {
  $dirs[] = $this->mockChild1;
  $dirs[] = $this->mockChild2;
  $dotFilesSwitch();
  $dirIterator = $this->dir
    ->getIterator();
  foreach ($dirs as $dir) {
    $this
      ->assertEquals($this
      ->getDirName($dir), $dirIterator
      ->key());
    $this
      ->assertTrue($dirIterator
      ->valid());
    if (!is_string($dir)) {
      $this
        ->assertSame($dir, $dirIterator
        ->current());
    }
    $dirIterator
      ->next();
  }
  $this
    ->assertFalse($dirIterator
    ->valid());
  $this
    ->assertNull($dirIterator
    ->key());
  $this
    ->assertNull($dirIterator
    ->current());
}