You are here

public function CacheTest::testFetchMulti in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CacheTest.php \Doctrine\Tests\Common\Cache\CacheTest::testFetchMulti()

File

vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CacheTest.php, line 32

Class

CacheTest

Namespace

Doctrine\Tests\Common\Cache

Code

public function testFetchMulti() {
  $cache = $this
    ->_getCacheDriver();
  $cache
    ->deleteAll();

  // Test saving some values, checking if it exists, and fetching it back with multiGet
  $this
    ->assertTrue($cache
    ->save('key1', 'value1'));
  $this
    ->assertTrue($cache
    ->save('key2', 'value2'));
  $this
    ->assertEquals(array(
    'key1' => 'value1',
    'key2' => 'value2',
  ), $cache
    ->fetchMultiple(array(
    'key1',
    'key2',
  )));
  $this
    ->assertEquals(array(
    'key1' => 'value1',
    'key2' => 'value2',
  ), $cache
    ->fetchMultiple(array(
    'key1',
    'key3',
    'key2',
  )));
  $this
    ->assertEquals(array(
    'key1' => 'value1',
    'key2' => 'value2',
  ), $cache
    ->fetchMultiple(array(
    'key1',
    'key2',
    'key3',
  )));
}