Пример #1
0
 public function testDynamic()
 {
     $preTime = time();
     $tpl = new Dwoo_Template_String('{$pre}{dynamic}{$pre}{/}', 10, 'testDynamic');
     $tpl->forceCompilation();
     $this->assertEquals($preTime . $preTime, $this->dwoo->get($tpl, array('pre' => $preTime), $this->compiler));
     sleep(1);
     $postTime = time();
     $this->assertEquals($preTime . $postTime, $this->dwoo->get($tpl, array('pre' => $postTime), $this->compiler));
     // fixes the init call not being called (which is normal)
     $fixCall = new Dwoo_Plugin_dynamic($this->dwoo);
     $fixCall->init('');
 }