TYPO3  7.6
ExcludeDirectoryFilterIteratorTest.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11 
12 namespace Symfony\Component\Finder\Tests\Iterator;
13 
16 
18 {
22  public function testAccept($directories, $expected)
23  {
24  $inner = new \RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->toAbsolute(), \FilesystemIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST);
25 
26  $iterator = new ExcludeDirectoryFilterIterator($inner, $directories);
27 
28  $this->assertIterator($expected, $iterator);
29  }
30 
31  public function getAcceptData()
32  {
33  $foo = array(
34  '.bar',
35  '.foo',
36  '.foo/.bar',
37  '.foo/bar',
38  '.git',
39  'test.py',
40  'test.php',
41  'toto',
42  'foo bar',
43  );
44 
45  $fo = array(
46  '.bar',
47  '.foo',
48  '.foo/.bar',
49  '.foo/bar',
50  '.git',
51  'test.py',
52  'foo',
53  'foo/bar.tmp',
54  'test.php',
55  'toto',
56  'foo bar',
57  );
58 
59  return array(
60  array(array('foo'), $this->toAbsolute($foo)),
61  array(array('fo'), $this->toAbsolute($fo)),
62  );
63  }
64 }