public function testSetConfiguration() { $configMock = $this->getMock('Doctrine\\Search\\Configuration'); $this->classMetadataFactory->setConfiguration($configMock); $reflClass = new \ReflectionClass($this->classMetadataFactory); $reflProperty = $reflClass->getProperty('config'); $reflProperty->setAccessible(true); $config = $reflProperty->getValue($this->classMetadataFactory); $this->assertInstanceOf('Doctrine\\Search\\Configuration', $config); }
/** * 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); }