You are here

public function DirectoryIterationTestCase::directoryIterationWithDot in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/DirectoryIterationTestCase.php \org\bovigo\vfs\DirectoryIterationTestCase::directoryIterationWithDot()

@test @dataProvider provideSwitchWithExpectations

Parameters

\Closure $dotFilesSwitch:

string[] $expectedDirectories:

File

vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/DirectoryIterationTestCase.php, line 86

Class

DirectoryIterationTestCase
Test for directory iteration.

Namespace

org\bovigo\vfs

Code

public function directoryIterationWithDot(\Closure $dotFilesSwitch, array $expectedDirectories) {
  $dotFilesSwitch();
  $dir = dir($this->fooURL . '/.');
  $i = 0;
  while (false !== ($entry = $dir
    ->read())) {
    $i++;
    $this
      ->assertTrue(in_array($entry, $expectedDirectories));
  }
  $this
    ->assertDirectoryCount(count($expectedDirectories), $i);
  $dir
    ->rewind();
  $i = 0;
  while (false !== ($entry = $dir
    ->read())) {
    $i++;
    $this
      ->assertTrue(in_array($entry, $expectedDirectories));
  }
  $this
    ->assertDirectoryCount(count($expectedDirectories), $i);
  $dir
    ->close();
}