/**
  * Tests the query getter and setter.
  */
 public function testQueryGetterSetter()
 {
     $event = new PreviewUrlCreateEvent('news', 12);
     $this->assertNull($event->getQuery());
     $event->setQuery('act=edit&id=12');
     $this->assertEquals('act=edit&id=12', $event->getQuery());
 }
 /**
  * Returns the ID.
  *
  * @param PreviewUrlCreateEvent $event
  * @param Request               $request
  *
  * @return int|string
  */
 private function getId(PreviewUrlCreateEvent $event, Request $request)
 {
     // Overwrite the ID if the event settings are edited
     if ('tl_calendar_events' === $request->query->get('table') && 'edit' === $request->query->get('act')) {
         return $request->query->get('id');
     }
     return $event->getId();
 }