You are here

public function FinderTest::testIgnoreDotFiles in Database Sanitize 7

File

vendor/symfony/finder/Tests/FinderTest.php, line 202

Class

FinderTest

Namespace

Symfony\Component\Finder\Tests

Code

public function testIgnoreDotFiles() {
  $finder = $this
    ->buildFinder();
  $this
    ->assertSame($finder, $finder
    ->ignoreDotFiles(false)
    ->ignoreVCS(false));
  $this
    ->assertIterator($this
    ->toAbsolute(array(
    '.git',
    '.bar',
    '.foo',
    '.foo/.bar',
    '.foo/bar',
    'foo',
    'foo/bar.tmp',
    'test.php',
    'test.py',
    'toto',
    'toto/.git',
    'foo bar',
  )), $finder
    ->in(self::$tmpDir)
    ->getIterator());
  $finder = $this
    ->buildFinder();
  $finder
    ->ignoreDotFiles(false)
    ->ignoreDotFiles(false)
    ->ignoreVCS(false);
  $this
    ->assertIterator($this
    ->toAbsolute(array(
    '.git',
    '.bar',
    '.foo',
    '.foo/.bar',
    '.foo/bar',
    'foo',
    'foo/bar.tmp',
    'test.php',
    'test.py',
    'toto',
    'toto/.git',
    'foo bar',
  )), $finder
    ->in(self::$tmpDir)
    ->getIterator());
  $finder = $this
    ->buildFinder();
  $this
    ->assertSame($finder, $finder
    ->ignoreDotFiles(true)
    ->ignoreVCS(false));
  $this
    ->assertIterator($this
    ->toAbsolute(array(
    'foo',
    'foo/bar.tmp',
    'test.php',
    'test.py',
    'toto',
    'foo bar',
  )), $finder
    ->in(self::$tmpDir)
    ->getIterator());
}