/** * @param MetaInformation metaInformationsy * @return \SolrInputDocument|null */ private function toDocument(MetaInformation $metaInformation) { $command = $this->commandFactory->get('all'); $this->entityMapper->setMappingCommand($command); $doc = $this->entityMapper->toDocument($metaInformation); return $doc; }
public function testToDocument_DocumentIsUpdated() { $mapper = new \FS\SolrBundle\Doctrine\Mapper\EntityMapper(); $mapper->setMappingCommand(new MapAllFieldsCommand(new AnnotationReader())); $actual = $mapper->toDocument(MetaTestInformationFactory::getMetaInformation()); $this->assertTrue($actual instanceof \SolrInputDocument); $this->assertTrue($actual->fieldExists('id')); }
public function testToDocument_DocumentIsUpdated() { $mapper = new \FS\SolrBundle\Doctrine\Mapper\EntityMapper($this->doctrineHydrator, $this->indexHydrator); $mapper->setMappingCommand(new MapAllFieldsCommand(new AnnotationReader())); $actual = $mapper->toDocument(MetaTestInformationFactory::getMetaInformation()); $this->assertTrue($actual instanceof Document); $this->assertNotNull($actual->id); }