Sha256: d98dc3754b4e57854e12e6ffa45a9210fdf7146d697be65e751d6e9f982dc88f
Contents?: true
Size: 1.37 KB
Versions: 18
Compression:
Stored size: 1.37 KB
Contents
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Finder\Tests\Iterator; 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 function getAcceptData() { return [ [['test.*'], [], ['test.php', 'test.py']], [[], ['test.*'], ['foo.php']], [['*.php'], ['test.*'], ['foo.php']], [['*.php', '*.py'], ['foo.*'], ['test.php', 'test.py']], [['/\.php$/'], [], ['test.php', 'foo.php']], [[], ['/\.php$/'], ['test.py']], ]; } } class InnerNameIterator extends \ArrayIterator { public function current() { return new \SplFileInfo(parent::current()); } public function getFilename() { return parent::current(); } }
Version data entries
18 entries across 18 versions & 1 rubygems