public function ScanDirectoryTest::testOptionRecurse in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/KernelTests/Core/File/ScanDirectoryTest.php \Drupal\KernelTests\Core\File\ScanDirectoryTest::testOptionRecurse()
- 9 core/tests/Drupal/KernelTests/Core/File/ScanDirectoryTest.php \Drupal\KernelTests\Core\File\ScanDirectoryTest::testOptionRecurse()
Check that the recurse option descends into subdirectories.
@covers ::scanDirectory
File
- core/
tests/ Drupal/ KernelTests/ Core/ File/ ScanDirectoryTest.php, line 147
Class
- ScanDirectoryTest
- Tests \Drupal\Core\File\FileSystem::scanDirectory.
Namespace
Drupal\KernelTests\Core\FileCode
public function testOptionRecurse() {
$files = $this->fileSystem
->scanDirectory($this->path . '/..', '/^javascript-/', [
'recurse' => FALSE,
]);
$this
->assertEmpty($files, "Without recursion couldn't find javascript files.");
$files = $this->fileSystem
->scanDirectory($this->path . '/..', '/^javascript-/', [
'recurse' => TRUE,
]);
$this
->assertCount(2, $files, 'With recursion we found the expected javascript files.');
}