1
0
mirror of synced 2025-01-19 06:51:40 +03:00

#954 DDC-2982 - Coverage for different instantiation of single-/multi-get cache regions

This commit is contained in:
Marco Pivetta 2015-01-17 23:42:15 +01:00
parent 564624814b
commit 95fe03b182

View File

@ -281,4 +281,36 @@ class DefaultCacheFactoryTest extends OrmTestCase
$this->assertSame('bar', $barRegion->getCache()->getNamespace());
}
public function testBuildsDefaultCacheRegionFromGenericCacheRegion()
{
/* @var $cache \Doctrine\Common\Cache\Cache */
$cache = $this->getMock('Doctrine\Common\Cache\Cache');
$factory = new DefaultCacheFactory($this->regionsConfig, $cache);
$this->assertInstanceOf(
'Doctrine\ORM\Cache\Region\DefaultRegion',
$factory->getRegion(array(
'region' => 'bar',
'usage' => ClassMetadata::CACHE_USAGE_READ_ONLY,
))
);
}
public function testBuildsMultiGetCacheRegionFromGenericCacheRegion()
{
/* @var $cache \Doctrine\Common\Cache\CacheProvider */
$cache = $this->getMockForAbstractClass('Doctrine\Common\Cache\CacheProvider');
$factory = new DefaultCacheFactory($this->regionsConfig, $cache);
$this->assertInstanceOf(
'Doctrine\ORM\Cache\Region\DefaultMultiGetRegion',
$factory->getRegion(array(
'region' => 'bar',
'usage' => ClassMetadata::CACHE_USAGE_READ_ONLY,
))
);
}
}