From 4b388b2ce8c5bf00b7ff18f0c7abe52d4a93d9dc Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Thu, 10 Apr 2014 04:09:45 +0200 Subject: [PATCH] DDC-3078 - coverage for the default cache instantiator --- .../Cache/DefaultCacheInstantiatorTest.php | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/Doctrine/Tests/ORM/Cache/DefaultCacheInstantiatorTest.php diff --git a/tests/Doctrine/Tests/ORM/Cache/DefaultCacheInstantiatorTest.php b/tests/Doctrine/Tests/ORM/Cache/DefaultCacheInstantiatorTest.php new file mode 100644 index 000000000..49c8573bc --- /dev/null +++ b/tests/Doctrine/Tests/ORM/Cache/DefaultCacheInstantiatorTest.php @@ -0,0 +1,29 @@ +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)); + } +}