use Symfony\Component\Finder\Iterator\FilenameFilterIterator;
class FilenameFilterIteratorTest extends IteratorTestCase
{ /**
* @dataProvider getAcceptData
*/
public function testAccept($matchPatterns,
$noMatchPatterns,
$expected) { $inner =
new InnerNameIterator(['test.php', 'test.py', 'foo.php'
]);
$iterator =
new FilenameFilterIterator($inner,
$matchPatterns,
$noMatchPatterns);
$this->
assertIterator($expected,
$iterator);
} public static function getAcceptData() { return [ [['test.*'
],
[],
['test.php', 'test.py'
]],
[[],
['test.*'
],
['foo.php'
]],
[['*.php'
],
['test.*'
],
['foo.php'
]],
[['*.php', '*.py'
],
['foo.*'
],
['test.php', 'test.py'
]],
[[