public function testSetMetadataCacheImpl() { $mockedMetadataCacheImpl = $this->getMock('\\Doctrine\\Common\\Cache\\Cache'); $this->configuration->setMetadataCacheImpl($mockedMetadataCacheImpl); $cacheMetadataImpl = $this->configuration->getMetadataCacheImpl(); $this->assertInstanceOf('\\Doctrine\\Common\\Cache\\Cache', $cacheMetadataImpl); }
/** * 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); }