public function testImportOutlook12() { $importer = new Calendar_Import_Ical(array('importContainerId' => $this->_testCalendar->getId())); $importer->importFile(dirname(__FILE__) . '/files/outlook12.ics'); $events = Calendar_Controller_Event::getInstance()->search(new Calendar_Model_EventFilter(array(array('field' => 'container_id', 'operator' => 'equals', 'value' => $this->_testCalendar->getId()))), NULL); $this->assertEquals(1, $events->count(), 'events where not imported'); }
/** * testImportRruleNormalize * * @see 0009856: ics import: recurring events one day earlier */ public function testImportRruleNormalize() { $importer = new Calendar_Import_Ical(array('container_id' => $this->_getTestCalendar()->getId())); $importer->importFile(dirname(__FILE__) . '/files/ni-zsk.ics'); // fetch first of may in 2014 $from = new Tinebase_DateTime('2014-04-23 22:00:00'); $until = new Tinebase_DateTime('2014-05-23 22:00:00'); $events = Calendar_Controller_Event::getInstance()->search(new Calendar_Model_EventFilter(array(array('field' => 'container_id', 'operator' => 'equals', 'value' => $this->_getTestCalendar()->getId()), array('field' => 'period', 'operator' => 'within', 'value' => array('from' => $from->toString(), 'until' => $until->toString())))), NULL); Calendar_Model_Rrule::mergeRecurrenceSet($events, $from, $until); $firstOfMay2014 = $events[1]; $this->assertEquals('2014-04-30 22:00:00', $firstOfMay2014->dtstart); }