/** * @param LifecycleEventArgs $args */ public function preRemove(LifecycleEventArgs $args) { $entity = $args->getDocument(); try { $this->solrFacade->removeDocument($entity); } catch (\RuntimeException $e) { } }
public function testRemoveDocument() { $this->eventManager->expects($this->once())->method('handle')->with(EventManager::DELETE); $this->setupMetaFactoryLoadOneCompleteInformation(); $solr = new SolrFacade($this->connectionFactory, $this->commandFactory, $this->eventManager, $this->metaFactory); $solr->removeDocument(new ValidTestEntity()); $this->assertTrue($this->solrClientFake->isCommited(), 'commit was never called'); }