Add test for helpers auto escaping

This commit is contained in:
Dmitriy Simushev 2014-01-31 15:12:44 +00:00
parent 44a6f96e96
commit 390bc70a0c

View File

@ -240,6 +240,12 @@ class HandlebarsTest extends \PHPUnit_Framework_TestCase
$engine->addHelper('dontrenderme', function() {return "{{test}}";});
$this->assertEquals('{{test}}', $engine->render('{{#dontrenderme}}', array()));
$engine->addHelper('markupHelper', function() {
return '<strong>Test</strong>';
});
$this->assertEquals('<strong>Test</strong>', $engine->render('{{{markupHelper}}}', array()));
$this->assertEquals('&lt;strong&gt;Test&lt;/strong&gt;', $engine->render('{{markupHelper}}', array()));
}
/**