/** * @covers Opt_Class::setCache * @covers Opt_Class::getCache */ public function testCacheReset() { $this->_tpl->setCache($obj = $this->getMock('Opt_Caching_Interface')); $this->assertSame($obj, $this->_tpl->getCache()); $this->_tpl->setCache(); $this->assertEquals(null, $this->_tpl->getCache()); return true; }
/** * Creates a new view object. The optional argument, $template * may specify the template to be associated with this view. * Please note that if you do not specify the template here, * you have to do this manually later using Opt_View::setTemplate() * method. * * @param string $template The template file. */ public function __construct($template = '') { $this->_tpl = Opl_Registry::get('opt'); $this->_template = (string) $template; $this->_parser = $this->_tpl->parser; $this->_cache = $this->_tpl->getCache(); }