$this->
assertEquals('ISO-8859-1',
$engine->
getCharset(), 'EngineInterface::setCharset() changes the default charset to use'
);
$this->
assertEquals('ISO-8859-1',
$helper->
getCharset(), 'EngineInterface::setCharset() changes the default charset of helper'
);
} public function testGlobalVariables() { $engine =
new ProjectTemplateEngine(new TemplateNameParser(),
$this->loader
);
$engine->
addGlobal('global_variable', 'lorem ipsum'
);
$this->
assertEquals([ 'global_variable' => 'lorem ipsum',
],
$engine->
getGlobals());
} public function testGlobalsGetPassedToTemplate() { $engine =
new ProjectTemplateEngine(new TemplateNameParser(),
$this->loader
);
$engine->
addGlobal('global', 'global variable'
);
$this->loader->
setTemplate('global.php', '<?php echo $global; ?>'
);
$this->
assertEquals('global variable',
$engine->
render('global.php'
));