コード例 #1
0
 /**
  * Delegation: Set the cache used by this View's compiler
  *
  * @param FluidCacheInterface $cache
  * @return void
  */
 public function setCache(FluidCacheInterface $cache)
 {
     $this->templateCompiler->setTemplateCache($cache);
 }
コード例 #2
0
 /**
  * @test
  */
 public function testStoreWhenDisabledFlushesCache()
 {
     $cache = $this->getMock('NamelessCoder\\Fluid\\Core\\Cache\\SimpleFileCache', array('flush', 'store'));
     $cache->expects($this->never())->method('store');
     $cache->expects($this->once())->method('flush')->with('fakeidentifier');
     $state = new ParsingState();
     $instance = new TemplateCompiler();
     $instance->disable();
     $instance->setTemplateCache($cache);
     $instance->store('fakeidentifier', $state);
 }