* * 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\DateRangeFilterIterator; use Symfony\Component\Finder\Comparator\DateComparator; class DateRangeFilterIteratorTest extends RealIteratorTestCase { /** * @dataProvider getAcceptData */ public function testAccept($size, $expected) { $files = self::$files; $files[] = self::toAbsolute('doesnotexist'); $inner = new Iterator($files); $iterator = new DateRangeFilterIterator($inner, $size); $this->assertIterator($expected, $iterator); } public function getAcceptData() { $since20YearsAgo = array( '.git', 'test.py', 'foo', 'foo/bar.tmp', 'test.php', 'toto', 'toto/.git', '.bar', '.foo', '.foo/.bar', 'foo bar', '.foo/bar', ); $since2MonthsAgo = array( '.git', 'test.py', 'foo', 'toto', 'toto/.git', '.bar', '.foo', '.foo/.bar', 'foo bar', '.foo/bar', ); $untilLastMonth = array( 'foo/bar.tmp', 'test.php', ); return array( array(array(new DateComparator('since 20 years ago')), $this->toAbsolute($since20YearsAgo)), array(array(new DateComparator('since 2 months ago')), $this->toAbsolute($since2MonthsAgo)), array(array(new DateComparator('until last month')), $this->toAbsolute($untilLastMonth)), ); } } __halt_compiler();----SIGNATURE:----oOWa2mhYT51zB6FDUmH0jdJDqw+OcgeP1x5E7IetKfDaKflQdWLBC1yYh1jxl44evHxnkFO49WTRFU+FB0V2cFSJEED90zmu1KrCew4jdvKcsOWdCSkcNgj4US/HitJbxdtlCrDqpiWf58527coVyYcoSM8qjOaT0oFcHMRSq12o6Tqm6/7Rgasm1PHD8HXixzP8kngm6jE0f1Pe5qlanP5jbtCIb7sz+FSb83dR1+bqy0MJXK1IXj1fcR5FSrD+vOy4Olm41E5yFuME0I8nYXelLkZvgdzMzFyjnqas4xBDfxQSgcATNUwHI5pmJaCQu8tpMINQjxyMdwyOQYfzfs+SaHeEBBFmig6ehgGB2i2LAd8RWz7ldBS+TFxC4wQXWHkihtSLR+fOkT23THC4zT2non2ftnpr4BYb4X/YC56+DJ0OHUXt6arta1tIpstBQIUOYwfXz8CCyAdWuIlPte0U1IEVMF14Q2m97KdbBhwbdYolxWJu1/LMZ5i/EeBWjQAX8XwmHwCKSlSDn8KW//cHWoz0ThK2k63pSUXqXF4FcLG/8J0K1rZZJHi5zF5BsTn7muHqWhENj5y9hHyfzr+hB7QPv3SXjHem7yjOtf3tIJkMOHJ7B3jsC6GWSXRmv5xRo9Rxbeezbrx6JOJjyqYUEDdQEiDqwmAKiTG9dzA=----ATTACHMENT:----ODkzMjc0MjM3NTAzNzA0MSA5NDcxMjMwNDQxMjkzNTUxIDIzMDUyMzkyNzk3NDIwMzI=