assertInstanceOf('Sabre\\VObject\\Component\\VCalendar', $vcal); $vcal = $vcal->expand(new DateTime('2015-01-01'), new DateTime('2016-01-01')); foreach ($vcal->VEVENT as $event) { $dates[] = $event->DTSTART->getValue(); } $expectedDates = [ "20150101T160000Z", "20150122T160000Z", "20150219T160000Z", "20150319T160000Z", "20150423T150000Z", "20150521T150000Z", "20150618T150000Z", "20150723T150000Z", "20150820T150000Z", "20150917T150000Z", "20151022T150000Z", "20151119T160000Z", "20151224T160000Z", ]; $this->assertEquals($expectedDates, $dates); } }