/** * @depends testValues */ function testFastForward() { $ev = new Component('VEVENT'); $ev->UID = 'bla'; $ev->RRULE = 'FREQ=YEARLY;COUNT=8;INTERVAL=5;BYMONTH=4,10;BYDAY=1MO,-1SU'; $dtStart = new Property\DateTime('DTSTART'); $dtStart->setDateTime(new DateTime('2011-04-04', new DateTimeZone('UTC')), Property\DateTime::UTC); $ev->add($dtStart); $vcal = Component::create('VCALENDAR'); $vcal->add($ev); $it = new 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', 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); }