Skip to content

Commit

Permalink
fixed DateComparator if file does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
avi123 authored and fabpot committed Aug 29, 2014
1 parent b03530b commit c6e9e06
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Expand Up @@ -44,6 +44,10 @@ public function accept()
{
$fileinfo = $this->current();

if (!file_exists($fileinfo->getRealPath())) {
return false;
}

$filedate = $fileinfo->getMTime();
foreach ($this->comparators as $compare) {
if (!$compare->test($filedate)) {
Expand Down
Expand Up @@ -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);

Expand Down

0 comments on commit c6e9e06

Please sign in to comment.