Пример #1
0
 /**
  * @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;
 }
Пример #2
0
 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'));
 }
Пример #3
0
 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);
 }