Implement template v2 feature of pushing to stack

This commit is contained in:
Kijin Sung 2023-10-18 02:23:18 +09:00
parent 7b518ab747
commit c19d71847f
5 changed files with 95 additions and 8 deletions

View file

@ -1038,6 +1038,19 @@ class TemplateParserV2Test extends \Codeception\Test\Unit
$this->_normalizeWhitespace($executed_output)
);
// Push stack
$tmpl = new \Rhymix\Framework\Template('./tests/_data/template', 'v2pushstack.html');
$tmpl->disableCache();
$executed_output = $tmpl->compile();
//Rhymix\Framework\Storage::write(\RX_BASEDIR . 'tests/_data/template/v2pushstack.executed.html', $executed_output);
$expected = file_get_contents(\RX_BASEDIR . 'tests/_data/template/v2pushstack.executed.html');
$this->assertEquals(
$this->_normalizeWhitespace($expected),
$this->_normalizeWhitespace($executed_output)
);
$this->assertEquals(4, count($tmpl->getStack('cms')));
// Validation error check
$tmpl = new \Rhymix\Framework\Template('./tests/_data/template', 'v2validation.html');
$tmpl->disableCache();