function ScanDirectoryTest::testOptionNoMask
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/File/ScanDirectoryTest.php \Drupal\KernelTests\Core\File\ScanDirectoryTest::testOptionNoMask()
- 10 core/tests/Drupal/KernelTests/Core/File/ScanDirectoryTest.php \Drupal\KernelTests\Core\File\ScanDirectoryTest::testOptionNoMask()
- 11.x core/tests/Drupal/KernelTests/Core/File/ScanDirectoryTest.php \Drupal\KernelTests\Core\File\ScanDirectoryTest::testOptionNoMask()
Check that the no-mask parameter is honored.
@covers ::scanDirectory
File
-
core/
tests/ Drupal/ KernelTests/ Core/ File/ ScanDirectoryTest.php, line 100
Class
- ScanDirectoryTest
- Tests \Drupal\Core\File\FileSystem::scanDirectory.
Namespace
Drupal\KernelTests\Core\FileCode
public function testOptionNoMask() {
// Grab a listing of all the JavaScript files.
$all_files = $this->fileSystem
->scanDirectory($this->path, '/^javascript-/');
$this->assertCount(2, $all_files, 'Found two, expected javascript files.');
// Now use the nomask parameter to filter out the .script file.
$filtered_files = $this->fileSystem
->scanDirectory($this->path, '/^javascript-/', [
'nomask' => '/.script$/',
]);
$this->assertCount(1, $filtered_files, 'Filtered correctly.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.