Beispiel #1
0
 /**
  * @test
  */
 public function removeEventFromObjectStorageHoldingEvents()
 {
     $event = new \KevinDitscheid\KdCalendar\Domain\Model\Event();
     $eventsObjectStorageMock = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage', array('detach'), array(), '', FALSE);
     $eventsObjectStorageMock->expects($this->once())->method('detach')->with($this->equalTo($event));
     $this->inject($this->subject, 'events', $eventsObjectStorageMock);
     $this->subject->removeEvent($event);
 }
 /**
  * Initialize the calendar repository
  */
 public function loadCalendars()
 {
     $calendars = $this->googleCalendarService->fetchCalendars();
     foreach ($calendars->getItems() as $calendarItem) {
         $calendar = $this->findById($calendarItem->getId())->getFirst();
         if ($calendar === NULL) {
             $calendar = \KevinDitscheid\KdCalendar\Domain\Model\Calendar::convert($calendarItem);
             $this->add($calendar);
         } else {
             $calendar = \KevinDitscheid\KdCalendar\Domain\Model\Calendar::convert($calendarItem, $calendar);
             $this->update($calendar);
         }
     }
     $this->persistCalendars();
 }
 /**
  * Reset the expire date
  *
  * @return void
  */
 public function resetExpireDate()
 {
     $this->registry->set('tx_kdcalendar', 'eventsexpired_' . $this->calendar->getId(), time() + 24 * 60 * 60);
 }