You are here

function FileScanDirectoryTest::testOptionNoMask in SimpleTest 7

Check that the no-mask parameter is honored.

File

tests/file.test, line 873
This provides SimpleTests for the core file handling functionality. These include FileValidateTest and FileSaveTest.

Class

FileScanDirectoryTest
Tests the file_scan_directory() function.

Code

function testOptionNoMask() {

  // Grab a listing of all the JavaSscript files.
  $all_files = file_scan_directory($this->path, '/^javascript-/');
  $this
    ->assertEqual(2, count($all_files), t('Found two, expected javascript files.'));

  // Now use the nomast parameter to filter out the .script file.
  $filtered_files = file_scan_directory($this->path, '/^javascript-/', array(
    'nomask' => '/.script$/',
  ));
  $this
    ->assertEqual(1, count($filtered_files), t('Filtered correctly.'));
}