/** * @depends testValues */ function testFastForward() { $ev = new Sabre_VObject_Component('VEVENT'); $ev->UID = 'bla'; $ev->RRULE = 'FREQ=YEARLY;COUNT=8;INTERVAL=5;BYMONTH=4,10;BYDAY=1MO,-1SU'; $dtStart = new Sabre_VObject_Property_DateTime('DTSTART'); $dtStart->setDateTime(new DateTime('2011-04-04'), Sabre_VObject_Property_DateTime::UTC); $ev->add($dtStart); $vcal = Sabre_VObject_Component::create('VCALENDAR'); $vcal->add($ev); $it = new Sabre_VObject_RecurrenceIterator($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')); $max = 20; $result = array(); while ($item = $it->current()) { $result[] = $item; $max--; if (!$max) { break; } $it->next(); } $tz = new DateTimeZone('UTC'); $this->assertEquals(array(), $result); }