You are here

function FileScanDirectoryTest::testOptionRecurse in SimpleTest 7

Check that the recurse option decends into subdirectories.

File

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

Class

FileScanDirectoryTest
Tests the file_scan_directory() function.

Code

function testOptionRecurse() {
  $files = file_scan_directory($this->originalFileDirectory, '/^javascript-/', array(
    'recurse' => FALSE,
  ));
  $this
    ->assertTrue(empty($files), t("Without recursion couldn't find javascript files."));
  $files = file_scan_directory($this->originalFileDirectory, '/^javascript-/', array(
    'recurse' => TRUE,
  ));
  $this
    ->assertEqual(2, count($files), t('With recursion we found the expected javascript files.'));
}