mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-29 23:32:54 +09:00
Add unit test for contextual escape
This commit is contained in:
parent
d7cf825a7d
commit
04a7734b2e
3 changed files with 75 additions and 0 deletions
|
|
@ -1220,6 +1220,24 @@ class TemplateParserV2Test extends \Codeception\Test\Unit
|
|||
$this->assertStringContainsString('/tests/_data/template/css/style.scss', array_first($list)['file']);
|
||||
}
|
||||
|
||||
public function testCompileContextualEscape()
|
||||
{
|
||||
// Contextual escape
|
||||
$tmpl = new \Rhymix\Framework\Template('./tests/_data/template', 'v2contextual.html');
|
||||
$tmpl->disableCache();
|
||||
$tmpl->setVars([
|
||||
'var' => 'Hello <"world"> (\'string\') variable.jpg'
|
||||
]);
|
||||
|
||||
$executed_output = $tmpl->compile();
|
||||
//Rhymix\Framework\Storage::write(\RX_BASEDIR . 'tests/_data/template/v2contextual.executed.html', $executed_output);
|
||||
$expected = file_get_contents(\RX_BASEDIR . 'tests/_data/template/v2contextual.executed.html');
|
||||
$this->assertEquals(
|
||||
$this->_normalizeWhitespace($expected),
|
||||
$this->_normalizeWhitespace($executed_output)
|
||||
);
|
||||
}
|
||||
|
||||
public function testCompileLang()
|
||||
{
|
||||
// Lang
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue