1
0
mirror of synced 2025-03-21 07:23:55 +03:00

Cache regions should not modify the injected cache instance settings

This commit is contained in:
Marco Pivetta 2015-01-15 21:01:02 +01:00
parent 0b2fb7fd78
commit f38d4551f1

View File

@ -2,6 +2,7 @@
namespace Doctrine\Tests\ORM\Cache;
use Doctrine\Common\Cache\ArrayCache;
use Doctrine\ORM\Cache\Region\DefaultRegion;
use Doctrine\Tests\Mocks\CacheEntryMock;
use Doctrine\Tests\Mocks\CacheKeyMock;
@ -47,4 +48,16 @@ class DefaultRegionTest extends AbstractRegionTest
$this->assertFalse($region1->contains($key));
$this->assertTrue($region2->contains($key));
}
public function testDoesNotModifyCacheNamespace()
{
$cache = new ArrayCache();
$cache->setNamespace('foo');
new DefaultRegion('bar', $cache);
new DefaultRegion('baz', $cache);
$this->assertSame('foo', $cache->getNamespace());
}
}