コード例 #1
0
 /**
  * @param LifecycleEventArgs $args
  */
 public function preRemove(LifecycleEventArgs $args)
 {
     $entity = $args->getDocument();
     try {
         $this->solrFacade->removeDocument($entity);
     } catch (\RuntimeException $e) {
     }
 }
コード例 #2
0
 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');
 }