Example #1
0
 public function before()
 {
     $this->calendar = Mockster::of(Calendar::class);
     $this->store = new EventStore();
     $this->uid = new FakeUidGenerator();
     $this->baseUrl = Url::fromString('http://example.com/ucdi');
     $this->givenNowIs('now');
     Mockster::stub($this->calendar->insertEvent(Arg::any(), Arg::any(), Arg::any(), Arg::any(), Arg::any()))->will()->call(function ($args) {
         return 'Event-' . $args['summary'];
     });
 }
Example #2
0
 private function deleteInsertedCalendarEvents($brickId)
 {
     foreach ($this->insertedCalendarEvents[$brickId] as $event) {
         $calendarId = $event->getCalendarId() ?: $this->settings->calendarId;
         // Older events don't have a calendarId
         $this->calendar->deleteEvent($calendarId, $event->getCalendarEventId());
     }
 }
Example #3
0
 /**
  * @return Parameter[]
  */
 public function parameters()
 {
     return [new Parameter('calendar', new NullableType(new EnumerationType($this->calendar->availableCalendars(), new StringType())), true)];
 }