Added test case for buildCachedCollectioHydrator on DefaultCacheFactory
This commit is contained in:
parent
b0792330e4
commit
77c2e24215
@ -281,4 +281,18 @@ class DefaultCacheFactoryTest extends OrmTestCase
|
|||||||
$this->assertSame('foo', $fooRegion->getCache()->getNamespace());
|
$this->assertSame('foo', $fooRegion->getCache()->getNamespace());
|
||||||
$this->assertSame('bar', $barRegion->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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user