TYPO3
7.6
Users
bogdan
Projects
Kapeli
Resources
Dash
Docsets
TYPO3
src
vendor
symfony
finder
Tests
Iterator
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
14
use
Symfony\Component\Finder\Iterator\CustomFilterIterator
;
15
16
class
CustomFilterIteratorTest
extends
IteratorTestCase
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
}
Generated on Wed Nov 11 2015 01:51:52 for TYPO3 by
1.8.3