This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/tests/Symfony/Tests/Component/Finder/Iterator/IgnoreVcsFilterIteratorTest.php
2010-08-20 23:09:55 +02:00

37 lines
1.1 KiB
PHP

<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Tests\Component\Finder\Iterator;
use Symfony\Component\Finder\Iterator\IgnoreVcsFilterIterator;
require_once __DIR__.'/RealIteratorTestCase.php';
class IgnoreVcsFilterIteratorTest extends RealIteratorTestCase
{
public function testAccept()
{
$inner = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator(sys_get_temp_dir().'/symfony2_finder', \FilesystemIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST);
//$inner = new Iterator(array('/.git/test.php', '/foo/test.py', '/bar/foo.php'));
$iterator = new IgnoreVcsFilterIterator($inner);
$tmpDir = sys_get_temp_dir().'/symfony2_finder';
$this->assertIterator(array(
$tmpDir.'/test.py',
$tmpDir.'/foo',
$tmpDir.'/foo/bar.tmp',
$tmpDir.'/test.php',
$tmpDir.'/toto'
), $iterator);
}
}