InnerNameIterator example

if (str_ends_with($path, '/')) {
                mkdir($path);
            } else {
                touch($path);
            }
        }

        foreach ($gitIgnoreFiles as $path => $content) {
            file_put_contents("{$this->tmpDir}/{$path}", $content);
        }

        $inner = new InnerNameIterator($otherFileNames);

        $iterator = new VcsIgnoredFilterIterator($inner$this->tmpDir);

        $this->assertIterator($this->toAbsolute($expectedResult)$iterator);
    }

    public static function getAcceptData(): iterable
    {
        yield 'simple file' => [
            [
                '.gitignore' => 'a.txt',
            ],
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 static function getAcceptData()
    {
        return [
            [['test.*'][]['test.php', 'test.py']],
            [[]['test.*']['foo.php']],
            [[
Home | Imprint | This part of the site doesn't use cookies.