public function setUp() { parent::setUp(); $sourceEntity = $this->_em->getClassMetadata(Travel::CLASSNAME); $targetEntity = $this->_em->getClassMetadata(City::CLASSNAME); $sourceEntity->associationMappings['visitedCities']['fetch'] = ClassMetadata::FETCH_EXTRA_LAZY; $targetEntity->associationMappings['travels']['fetch'] = ClassMetadata::FETCH_EXTRA_LAZY; }
protected function setUp() { $this->enableSecondLevelCache(); parent::setUp(); $this->cacheFactory = new CacheFactorySecondLevelCacheConcurrentTest($this->getSharedSecondLevelCacheDriverImpl()); $this->_em->getConfiguration()->getSecondLevelCacheConfiguration()->setCacheFactory($this->cacheFactory); $this->countryMetadata = $this->_em->getClassMetadata(Country::CLASSNAME); $countryMetadata = clone $this->countryMetadata; $countryMetadata->cache['usage'] = ClassMetadata::CACHE_USAGE_NONSTRICT_READ_WRITE; $this->_em->getMetadataFactory()->setMetadataFor(Country::CLASSNAME, $countryMetadata); }