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); + } }