You are here

public function ChainCacheTest::testFetchPropagateToFastestCache in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ChainCacheTest.php \Doctrine\Tests\Common\Cache\ChainCacheTest::testFetchPropagateToFastestCache()

File

vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ChainCacheTest.php, line 37

Class

ChainCacheTest

Namespace

Doctrine\Tests\Common\Cache

Code

public function testFetchPropagateToFastestCache() {
  $cache1 = new ArrayCache();
  $cache2 = new ArrayCache();
  $cache2
    ->save('bar', 'value');
  $chainCache = new ChainCache(array(
    $cache1,
    $cache2,
  ));
  $this
    ->assertFalse($cache1
    ->contains('bar'));
  $result = $chainCache
    ->fetch('bar');
  $this
    ->assertEquals('value', $result);
  $this
    ->assertTrue($cache2
    ->contains('bar'));
}