* * 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:----RTAZPjceKGwMvHzNYJEaN07FBp/XUHogz50wLRCYVncdGeFsj/SEBIezDYA4nJU7nCofRuJb1RD0CVRaJ8dP8K4xbV0Zk/SibmzXPiVOLrQkoc3aY1Ouz7hwWqw/imzxBMCAZlNi+k2WgGtY2t55WYlyvNtVHTGeB+rUeDmuy+s/lsX+/pBF1a0rN3q1Rlsd6gq7Nd4aYm1/qiCZlwKWxxqFXWidAUDOR+Y47/uEPBEHiOM74dH5yjdARCDxFC43D971933awolAzstmwHRKeKBwuYZBsPgEroc/U/bMW65qrKuOL5B7oG/NJb3xm1bKPqVbCXtu3Zw2v6/OQEP/umcOyZgteqADKwh2KpUZ8Rn/lE956+DoBQNZzVbO2aK4kOAdtL1tmaGDNuSgNpoK4wI8I4QgV2dSoiN8op/msep5FGG6HsfrPp+YEZziRzdEsYdxMkmtGOKVGvwC1q+xDdm+c/8ZKMhPcmdZJv6zxa/FffzG1TQqI1OTJMUhcqmZeRqD8jhP3lwwAdFE8ifFBjAtAM9nZSyxRMjTN3AZAQyp5lBD2Xt7/h6Zerw4jfNwPUeOGkFgCk2GaOf5QcPDcSWEBiMKm1ldhZuO+LG7CajfIqFF8dmkRUBvBsHQjWBLX6ZR5dv4gDFPz/pV9jUaRL+dmxfuGXiTtFfQbbEV/1Y=----ATTACHMENT:----NzcwNDUwMjMzNjcyMTAzNSA0ODk5MjE2NDMzNjY5MTY3IDI5NDY2MzgxMjgwOTY3NA==