/**
  * testItLogsToOutputIfAnExceptionIsThrownDuringIndexing
  */
 public function testItLogsToOutputIfAnExceptionIsThrownDuringIndexing()
 {
     $this->container->expects($this->at(0))->method('get')->with($this->equalTo('sulu_event.event_manager'))->will($this->returnValue($this->eventManager));
     $this->container->expects($this->at(1))->method('get')->with($this->equalTo('massive_search.search_manager'))->will($this->returnValue($this->searchManager));
     $eventMock = $this->getMock(Event::class);
     $eventMock->expects($this->any())->method('getTitle')->will($this->returnValue('FooBarEvent'));
     $eventMocks = array($eventMock);
     $this->eventManager->expects($this->once())->method('findAll')->will($this->returnValue($eventMocks));
     $this->searchManager->expects($this->exactly(1))->method('index')->with($eventMock)->willThrowException(new \Exception('Something went wrong!'));
     $this->output->expects($this->at(1))->method('writeln')->with($this->stringContains('(path: FooBarEvent: Something went wrong!'));
     $reindexCommand = new ReindexCommand();
     $reindexCommand->setContainer($this->container);
     $reindexCommand->execute($this->input, $this->output);
 }