public function DirectoryIterationTestCase::directoryIteration in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/DirectoryIterationTestCase.php \org\bovigo\vfs\DirectoryIterationTestCase::directoryIteration()
@test @dataProvider provideSwitchWithExpectations
Parameters
\Closure $dotFilesSwitch:
string[] $expectedDirectories:
File
- vendor/
mikey179/ vfsStream/ src/ test/ php/ org/ bovigo/ vfs/ DirectoryIterationTestCase.php, line 58
Class
- DirectoryIterationTestCase
- Test for directory iteration.
Namespace
org\bovigo\vfsCode
public function directoryIteration(\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();
}