/**
  * @param CalendarEvent $event
  *
  * @return array
  */
 protected function serializeCalendarEvent(CalendarEvent $event)
 {
     return ['id' => $event->getId(), 'title' => $event->getTitle(), 'description' => $event->getDescription(), 'start' => $event->getStart(), 'end' => $event->getEnd(), 'allDay' => $event->getAllDay(), 'backgroundColor' => $event->getBackgroundColor(), 'createdAt' => $event->getCreatedAt(), 'updatedAt' => $event->getUpdatedAt(), 'invitationStatus' => $event->getInvitationStatus(), 'parentEventId' => $event->getParent() ? $event->getParent()->getId() : null, 'calendar' => $event->getCalendar() ? $event->getCalendar()->getId() : null];
 }
 /**
  * @param CalendarEvent $expected
  * @param CalendarEvent $actual
  */
 protected function assertEventDataEquals(CalendarEvent $expected, CalendarEvent $actual)
 {
     $this->assertEquals($expected->getTitle(), $actual->getTitle());
     $this->assertEquals($expected->getDescription(), $actual->getDescription());
     $this->assertEquals($expected->getStart(), $actual->getStart());
     $this->assertEquals($expected->getEnd(), $actual->getEnd());
     $this->assertEquals($expected->getAllDay(), $actual->getAllDay());
 }
 /**
  * @param CalendarEvent $parentCalendarEvent
  * @param User $user
  * @return CalendarEvent
  */
 protected function createChildEvent(CalendarEvent $parentCalendarEvent, User $user)
 {
     $userCalendar = $this->getDefaultUserCalendar($user);
     $childCalendarEvent = new CalendarEvent();
     $childCalendarEvent->setStart($parentCalendarEvent->getStart())->setEnd($parentCalendarEvent->getEnd())->setTitle($parentCalendarEvent->getTitle())->setCalendar($userCalendar)->setAllDay(false);
     $parentCalendarEvent->addChildEvent($childCalendarEvent);
     return $childCalendarEvent;
 }