/** * @expectedException RuntimeException */ public function testGetRepository_UserdefinedInvalidRepository() { $metaInformation = new MetaInformation(); $metaInformation->setClassName(get_class(new EntityWithRepository())); $metaInformation->setRepository('FS\\SolrBundle\\Tests\\Doctrine\\Annotation\\Entities\\InvalidEntityRepository'); $this->setupMetaFactoryLoadOneCompleteInformation($metaInformation); $solr = new Solr($this->solrClientFake, $this->commandFactory, $this->eventDispatcher, $this->metaFactory, $this->mapper); $solr->getRepository('Tests:EntityWithInvalidRepository'); }
/** * @inheritdoc */ public function remove($entity) { $repo = $this->modelManager->get($this->getModel()); $solrRepo = $this->solr->getRepository($repo->getClassName()); $solrRepo->delete($entity); }