From 77c2e24215695e1b9de8aba1d9f0d07dc6b7af0d Mon Sep 17 00:00:00 2001 From: Asmir Mustafic Date: Sat, 17 Jan 2015 00:15:27 +0100 Subject: [PATCH] Added test case for buildCachedCollectioHydrator on DefaultCacheFactory --- .../Tests/ORM/Cache/DefaultCacheFactoryTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/Doctrine/Tests/ORM/Cache/DefaultCacheFactoryTest.php b/tests/Doctrine/Tests/ORM/Cache/DefaultCacheFactoryTest.php index c6dc3b501..ea5b9cf9e 100644 --- a/tests/Doctrine/Tests/ORM/Cache/DefaultCacheFactoryTest.php +++ b/tests/Doctrine/Tests/ORM/Cache/DefaultCacheFactoryTest.php @@ -281,4 +281,18 @@ class DefaultCacheFactoryTest extends OrmTestCase $this->assertSame('foo', $fooRegion->getCache()->getNamespace()); $this->assertSame('bar', $barRegion->getCache()->getNamespace()); } + + public function testBuildCachedCollectioHydrator() + { + $em = $this->em; + $entityName = 'Doctrine\Tests\Models\Cache\State'; + $metadata = $em->getClassMetadata($entityName); + $mapping = $metadata->associationMappings['cities']; + + $mapping['cache']['usage'] = ClassMetadata::CACHE_USAGE_READ_ONLY; + + $hydrator = $this->factory->buildCollectionHydrator($em, $mapping); + + $this->assertInstanceOf('Doctrine\ORM\Cache\MultiGetCollectionHydrator', $hydrator); + } }