Esempio n. 1
0
 public function testClearCacheOnTemplateClass()
 {
     $dwoo = new Dwoo_Core(DWOO_COMPILE_DIR, DWOO_CACHE_DIR);
     $dwoo->setCacheTime(10);
     $tpl = new Dwoo_Template_String('foo{$foo}bar', null, 'cachetest2');
     $tpl->forceCompilation();
     $this->assertEquals("foo1bar", $dwoo->get($tpl, array('foo' => 1)));
     $this->assertEquals(true, $dwoo->isCached($tpl));
     $this->assertEquals("foo1bar", $dwoo->get($tpl, array('foo' => 1)));
     $this->assertEquals(false, $tpl->clearCache($dwoo, 10));
     $this->assertEquals(true, $tpl->clearCache($dwoo, -1));
     $this->assertEquals(false, $dwoo->isCached($tpl));
 }