You are here

public function ChainCacheTest::testOnlyFetchFirstOne in Zircon Profile 8.0

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

File

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

Class

ChainCacheTest

Namespace

Doctrine\Tests\Common\Cache

Code

public function testOnlyFetchFirstOne() {
  $cache1 = new ArrayCache();
  $cache2 = $this
    ->getMockForAbstractClass('Doctrine\\Common\\Cache\\CacheProvider');
  $cache2
    ->expects($this
    ->never())
    ->method('doFetch');
  $chainCache = new ChainCache(array(
    $cache1,
    $cache2,
  ));
  $chainCache
    ->save('id', 'bar');
  $this
    ->assertEquals('bar', $chainCache
    ->fetch('id'));
}