config = new CacheConfiguration(); } /** * @covers \Doctrine\ORM\Cache\CacheConfiguration::getCacheInstantiator */ public function testGetDefaultCacheIstantiator() { $this->assertInstanceOf('Doctrine\ORM\Cache\DefaultInstantiator', $this->config->getCacheInstantiator()); } /** * @covers \Doctrine\ORM\Cache\CacheConfiguration::getCacheInstantiator */ public function testSetGetCacheIstantiator() { $istantiator = $this->getMock('Doctrine\ORM\Cache\CacheInstantiator'); $this->config->setCacheInstantiator($istantiator); $this->assertSame($istantiator, $this->config->getCacheInstantiator()); } public function testSetGetRegionLifetime() { $config = $this->config->getRegionsConfiguration(); $config->setDefaultLifetime(111); $this->assertEquals($config->getDefaultLifetime(), $config->getLifetime('foo_region')); $config->setLifetime('foo_region', 222); $this->assertEquals(222, $config->getLifetime('foo_region')); } public function testSetGetCacheLogger() { $logger = $this->getMock('Doctrine\ORM\Cache\Logging\CacheLogger'); $this->assertNull($this->config->getCacheLogger()); $this->config->setCacheLogger($logger); $this->assertEquals($logger, $this->config->getCacheLogger()); } public function testSetGetCacheFactory() { $factory = $this->getMock('Doctrine\ORM\Cache\CacheFactory'); $this->assertNull($this->config->getCacheFactory()); $this->config->setCacheFactory($factory); $this->assertEquals($factory, $this->config->getCacheFactory()); } public function testSetGetQueryValidator() { $validator = $this->getMock('Doctrine\ORM\Cache\QueryCacheValidator'); $this->assertInstanceOf('Doctrine\ORM\Cache\TimestampQueryCacheValidator', $this->config->getQueryValidator()); $this->config->setQueryValidator($validator); $this->assertEquals($validator, $this->config->getQueryValidator()); } }