DDC-3078 - coverage for the default cache instantiator
This commit is contained in:
parent
a790639167
commit
4b388b2ce8
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Doctrine\Tests\ORM\Cache;
|
||||||
|
|
||||||
|
use Doctrine\ORM\Cache\DefaultCacheInstantiator;
|
||||||
|
use Doctrine\Tests\OrmTestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @covers \Doctrine\ORM\Cache\DefaultCacheInstantiator
|
||||||
|
*/
|
||||||
|
class DefaultCacheInstantiatorTest extends OrmTestCase
|
||||||
|
{
|
||||||
|
public function testGetCache()
|
||||||
|
{
|
||||||
|
$entityManager = $this->getMock('Doctrine\ORM\EntityManagerInterface');
|
||||||
|
$config = $this->getMock('Doctrine\ORM\Configuration');
|
||||||
|
$cacheConfig = $this->getMock('Doctrine\ORM\Cache\CacheConfiguration');
|
||||||
|
|
||||||
|
$entityManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($config));
|
||||||
|
$config
|
||||||
|
->expects($this->any())
|
||||||
|
->method('getSecondLevelCacheConfiguration')
|
||||||
|
->will($this->returnValue($cacheConfig));
|
||||||
|
|
||||||
|
$instantiator = new DefaultCacheInstantiator();
|
||||||
|
|
||||||
|
$this->assertInstanceOf('Doctrine\ORM\Cache\DefaultCache', $instantiator->getCache($entityManager));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user