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/SizeRangeFilterIteratorTest.php
2010-08-20 23:09:55 +02:00

40 lines
1.2 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\SizeRangeFilterIterator;
use Symfony\Component\Finder\Comparator\NumberComparator;
require_once __DIR__.'/RealIteratorTestCase.php';
class SizeRangeFilterIteratorTest extends RealIteratorTestCase
{
/**
* @dataProvider getAcceptData
*/
public function testAccept($size, $expected)
{
$inner = new Iterator(self::$files);
$iterator = new SizeRangeFilterIterator($inner, $size);
$this->assertIterator($expected, $iterator);
}
public function getAcceptData()
{
return array(
array(array(new NumberComparator('< 1K'), new NumberComparator('> 0.5K')), array(sys_get_temp_dir().'/symfony2_finder/.git', sys_get_temp_dir().'/symfony2_finder/foo', sys_get_temp_dir().'/symfony2_finder/test.php', sys_get_temp_dir().'/symfony2_finder/toto')),
);
}
}