Ejemplo n.º 1
0
 public function testSetSearchManager()
 {
     $smMock = $this->getMock('Doctrine\\Search\\SearchManager', array(), array(), '', false);
     $this->classMetadataFactory->setSearchManager($smMock);
     $reflClass = new \ReflectionClass($this->classMetadataFactory);
     $reflProperty = $reflClass->getProperty('sm');
     $reflProperty->setAccessible(true);
     $sm = $reflProperty->getValue($this->classMetadataFactory);
     $this->assertInstanceOf('Doctrine\\Search\\SearchManager', $sm);
 }
Ejemplo n.º 2
0
 /**
  * Constructor
  *
  * @param Configuration         $config
  * @param SearchClientInterface $client
  * @param EventManager          $eventManager
  */
 public function __construct(Configuration $config, SearchClientInterface $client, EventManager $eventManager)
 {
     $this->configuration = $config;
     $this->client = $client;
     $this->eventManager = $eventManager;
     $this->metadataFactory = $this->configuration->getClassMetadataFactory();
     $this->metadataFactory->setSearchManager($this);
     $this->metadataFactory->setConfiguration($this->configuration);
     $this->metadataFactory->setCacheDriver($this->configuration->getMetadataCacheImpl());
     $this->serializer = $this->configuration->getEntitySerializer();
     $this->entityManager = $this->configuration->getEntityManager();
     $this->unitOfWork = new UnitOfWork($this);
 }