You are here

function FileScanDirectoryTest::testOptionMinDepth in SimpleTest 7

Check that the min_depth options lets us ignore files in the starting directory.

File

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

Class

FileScanDirectoryTest
Tests the file_scan_directory() function.

Code

function testOptionMinDepth() {
  $files = file_scan_directory($this->path, '/^javascript-/', array(
    'min_depth' => 0,
  ));
  $this
    ->assertEqual(2, count($files), t('No minimum-depth gets files in current directory.'));
  $files = file_scan_directory($this->path, '/^javascript-/', array(
    'min_depth' => 1,
  ));
  $this
    ->assertTrue(empty($files), t("Minimum-depth of 1 successfully excludes files from current directory."));
}