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']; }); }
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()); } }
/** * @return Parameter[] */ public function parameters() { return [new Parameter('calendar', new NullableType(new EnumerationType($this->calendar->availableCalendars(), new StringType())), true)]; }