function FileScanDirectoryTest::testOptionNoMask

Check that the no-mask parameter is honored.

File

modules/simpletest/tests/file.test, line 1312

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), '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), 'Filtered correctly.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.