public function fetch($template, $parameters = [])
{
try {
if (count($parameters) > 0) {
$this->smarty->assign($parameters);
}
return $this->smarty->fetch($template);
} catch (\Exception $e) {
throw new SmartyException($e->getMessage());
}
}
/** * @dataProvider dataProvider */ public function testRegisterExtensions(Smarty $smarty) { DemoComponent::setConfig(__DIR__ . '/Mocks/DemoComponentConfig.yaml'); $smarty->registerExtensions(); $smarty->assign('name', 'WORLD'); $result = $smarty->fetch('DemoComponent.tpl'); $this->assertSame('Hello world', $result); }