fixed DateComparator if file does not exist
This commit is contained in:
parent
b03530b781
commit
c6e9e06abb
@ -44,6 +44,10 @@ class DateRangeFilterIterator extends FilterIterator
|
||||
{
|
||||
$fileinfo = $this->current();
|
||||
|
||||
if (!file_exists($fileinfo->getRealPath())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$filedate = $fileinfo->getMTime();
|
||||
foreach ($this->comparators as $compare) {
|
||||
if (!$compare->test($filedate)) {
|
||||
|
@ -21,7 +21,9 @@ class DateRangeFilterIteratorTest extends RealIteratorTestCase
|
||||
*/
|
||||
public function testAccept($size, $expected)
|
||||
{
|
||||
$inner = new Iterator(self::$files);
|
||||
$files = self::$files;
|
||||
$files[] = self::toAbsolute('doesnotexist');
|
||||
$inner = new Iterator($files);
|
||||
|
||||
$iterator = new DateRangeFilterIterator($inner, $size);
|
||||
|
||||
|
Reference in New Issue
Block a user