Exemplo n.º 1
0
 public function testToEntity_ConcreteDocumentClass_WithDoctrine()
 {
     $targetEntity = new ValidTestEntity();
     $this->indexHydrator->expects($this->once())->method('hydrate')->will($this->returnValue($targetEntity));
     $this->doctrineHydrator->expects($this->once())->method('hydrate')->will($this->returnValue($targetEntity));
     $mapper = new \FS\SolrBundle\Doctrine\Mapper\EntityMapper($this->doctrineHydrator, $this->indexHydrator, $this->metaInformationFactory);
     $mapper->setHydrationMode(HydrationModes::HYDRATE_DOCTRINE);
     $entity = $mapper->toEntity(new Document(array()), $targetEntity);
     $this->assertTrue($entity instanceof $targetEntity);
 }