コード例 #1
0
 /**
  * Tests the collection of a cache hit.
  */
 public function testCacheCollectorHit()
 {
     $cache = new \StdClass();
     $cache->cid = 'cache_id';
     $cache->expire = 1;
     $cache->tags = ['tag1', 'tag2'];
     $this->cacheBackendInterface->expects($this->once())->method('get')->will($this->returnValue($cache));
     $cacheBackendWrapper = new CacheBackendWrapper($this->cacheDataCollector, $this->cacheBackendInterface, 'default');
     $cache2 = $cacheBackendWrapper->get('cache_id');
     $this->assertNotNull($cache2);
     $this->assertEquals(1, $this->cacheDataCollector->getCacheHitsCount());
 }