getOccurrencesBetween() public method

Get occurrences between two DateTimes, exclusive. Does not modify $this.
public getOccurrencesBetween ( $startDate, $endDate, $limit = NULL )
 /**
  * Check that we don't alter results
  * DTSTART;TZID=America/New_York:19970902T090000
  * RRULE:FREQ=WEEKLY;
  *
  * '2001-07-03 09:00:00' = #201
  * '2001-07-31 09:00:00' = #205
  */
 function testCurruptingThis()
 {
     $results[] = new DateTime('2001-07-03 09:00:00');
     $results[] = new DateTime('2001-07-10 09:00:00');
     $results[] = new DateTime('2001-07-17 09:00:00');
     $results[] = new DateTime('2001-07-24 09:00:00');
     $results[] = new DateTime('2001-07-31 09:00:00');
     $r = new When();
     $r->startDate(new DateTime("19970902T090000"))->rrule("FREQ=WEEKLY;");
     $occurrences = $r->getOccurrencesBetween(new DateTime("20010521T090000"), new DateTime("20010612T090000"));
     $occurrences2 = $r->getOccurrencesBetween(new DateTime("20010702T090000"), new DateTime("20010801T090000"));
     foreach ($results as $key => $result) {
         $this->assertEquals($result, $occurrences2[$key]);
     }
 }