Fixed minor unit tests

This commit is contained in:
Simon Wisselink
2023-01-11 00:00:07 +01:00
parent 51075e0421
commit ad245ccd0c
3 changed files with 5 additions and 5 deletions

View File

@@ -473,7 +473,7 @@ class Template extends BaseCompiler {
public function compileTag($tag, $args, $parameter = []) {
$this->prefixCodeStack[] = $this->prefix_code;
$this->prefix_code = [];
$result = $this->compileTag2($tag, $args, $parameter);
$result = $this->compileTag2(strtolower($tag), $args, $parameter);
$this->prefix_code = array_merge($this->prefix_code, array_pop($this->prefixCodeStack));
return $result;
}

View File

@@ -726,8 +726,8 @@ class Template extends TemplateBase {
*
* @api Smarty::isCached()
*/
public function isCached($template = null, $cache_id = null, $compile_id = null, $parent = null) {
return $this->_execute($template, $cache_id, $compile_id, $parent, 2);
public function isCached($template = null, $cache_id = null, $compile_id = null, $parent = null): bool {
return (bool) $this->_execute($template, $cache_id, $compile_id, $parent, 2);
}
/**

View File

@@ -401,7 +401,7 @@ class PluginFunctionHtmlSelectDateTest extends PHPUnit_Smarty
$result = '<select name="Date_Month">' . $n . $this->months['default'] . $n . '</select>'
. $n . '<select name="Date_Day">' . $n . '<option value="">day</option>' . $n . $this->days['none'] . $n . '</select>'
. $n . '<select name="Date_Year">' . $n . $this->years['start_2005'] . $n . '</select>';
$tpl = $this->smarty->createTemplate('eval:{html_select_date time="2022-02-" day_empty="day" start_year=2005}');
$tpl = $this->smarty->createTemplate('eval:{html_select_date time="' . date('Y', $this->now) . '-02-" day_empty="day" start_year=2005}');
$this->assertEquals($result, $tpl->fetch());
}
@@ -410,7 +410,7 @@ class PluginFunctionHtmlSelectDateTest extends PHPUnit_Smarty
$result = '<select name="Date_Month">' . $n . '<option value="">month</option>' . $n . $this->months['none'] . $n . '</select>'
. $n . '<select name="Date_Day">' . $n . $this->days['default'] . $n . '</select>'
. $n . '<select name="Date_Year">' . $n . $this->years['start_2005'] . $n . '</select>';
$tpl = $this->smarty->createTemplate('eval:{html_select_date time="2022--20" month_empty="month" start_year=2005}');
$tpl = $this->smarty->createTemplate('eval:{html_select_date time="' . date('Y', $this->now) . '--20" month_empty="month" start_year=2005}');
$this->assertEquals($result, $tpl->fetch());
}