/**
* @depends testValues
*/
function testFastForward()
{
$vcal = new VCalendar();
$ev = $vcal->createComponent('VEVENT');
$ev->UID = 'bla';
$ev->RRULE = 'FREQ=YEARLY;COUNT=8;INTERVAL=5;BYMONTH=4,10;BYDAY=1MO,-1SU';
$dtStart = $vcal->createProperty('DTSTART');
$dtStart->setDateTime(new DateTime('2011-04-04', new DateTimeZone('UTC')));
$ev->add($dtStart);
$vcal->add($ev);
$it = new EventIterator($vcal, (string) $ev->uid);
// The idea is that we're fast-forwarding too far in the future, so
// there will be no results left.
$it->fastForward(new DateTime('2020-05-05', new DateTimeZone('UTC')));
$max = 20;
$result = array();
while ($item = $it->current()) {
$result[] = $item;
$max--;
if (!$max) {
break;
}
$it->next();
}
$tz = new DateTimeZone('UTC');
$this->assertEquals(array(), $result);
}