TYPO3  7.6
CustomFilterIteratorTest.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 
15 
17 {
21  public function testWithInvalidFilter()
22  {
23  new CustomFilterIterator(new Iterator(), array('foo'));
24  }
25 
29  public function testAccept($filters, $expected)
30  {
31  $inner = new Iterator(array('test.php', 'test.py', 'foo.php'));
32 
33  $iterator = new CustomFilterIterator($inner, $filters);
34 
35  $this->assertIterator($expected, $iterator);
36  }
37 
38  public function getAcceptData()
39  {
40  return array(
41  array(array(function (\SplFileInfo $fileinfo) { return false; }), array()),
42  array(array(function (\SplFileInfo $fileinfo) { return 0 === strpos($fileinfo, 'test'); }), array('test.php', 'test.py')),
43  array(array('is_dir'), array()),
44  );
45  }
46 }