You are here

function ScanDirectoryTest::testOptionMinDepth in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/system/src/Tests/File/ScanDirectoryTest.php \Drupal\system\Tests\File\ScanDirectoryTest::testOptionMinDepth()

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

File

core/modules/system/src/Tests/File/ScanDirectoryTest.php, line 142
Contains \Drupal\system\Tests\File\ScanDirectoryTest.

Class

ScanDirectoryTest
Tests the file_scan_directory() function.

Namespace

Drupal\system\Tests\File

Code

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