public function testCustomClassPluginInstanceAsModifier() { $dwoo = new Dwoo(DWOO_COMPILE_DIR, DWOO_CACHE_DIR); $dwoo->addPlugin('CustomClassPlugin', array(new custom_class_plugin_obj(), 'call')); $tpl = new Dwoo_Template_String('{$foo=4}{$foo|CustomClassPlugin:5}'); $tpl->forceCompilation(); $this->assertEquals('20', $dwoo->get($tpl, array(), $this->compiler)); }
public function testCallingMethodOnPropery() { $tpl = new Dwoo_Template_String('{getobj()->instance->Bar("hoy")}'); $tpl->forceCompilation(); $dwoo = new Dwoo(DWOO_COMPILE_DIR, DWOO_CACHE_DIR); $dwoo->addPlugin('getobj', array(new PluginHelper(), 'call')); $this->assertEquals('HOY', $dwoo->get($tpl, array(), $this->compiler)); }