diff --git a/tests/Doctrine/Tests/ORM/Cache/MultiGetRegionTest.php b/tests/Doctrine/Tests/ORM/Cache/MultiGetRegionTest.php new file mode 100644 index 000000000..fd0c0bda2 --- /dev/null +++ b/tests/Doctrine/Tests/ORM/Cache/MultiGetRegionTest.php @@ -0,0 +1,39 @@ + + */ +class MultiGetRegionTest extends AbstractRegionTest +{ + protected function createRegion() + { + return new DefaultMultiGetRegion('default.region.test', $this->cache); + } + + public function testGetMulti() + { + $key1 = new CacheKeyMock('key.1'); + $value1 = new CacheEntryMock(array('id'=>1, 'name' => 'bar')); + + $key2 = new CacheKeyMock('key.2'); + $value2 = new CacheEntryMock(array('id'=>2, 'name' => 'bar')); + + $this->assertFalse($this->region->contains($key1)); + $this->assertFalse($this->region->contains($key2)); + + $this->region->put($key1, $value1); + $this->region->put($key2, $value2); + + $actual = $this->region->getMulti(array($key1, $key2)); + + $this->assertEquals($value1, $actual[0]); + $this->assertEquals($value2, $actual[1]); + } +}