Merge pull request #121 from mmontagna/master

Fixes a incompatibility with handlebars.js
This commit is contained in:
Dmitriy Simushev 2015-06-23 23:46:56 +03:00
commit f3067cb41a
2 changed files with 1 additions and 9 deletions

View File

@ -404,7 +404,7 @@ class Template
// fallback to mustache style each/with/for just if there is
// no argument at all.
try {
$sectionVar = $context->get($sectionName, true);
$sectionVar = $context->get($sectionName, false);
} catch (\InvalidArgumentException $e) {
throw new \RuntimeException(
sprintf(

View File

@ -454,14 +454,6 @@ class HandlebarsTest extends \PHPUnit_Framework_TestCase
$engine->getHelpers()->call('invalid', $engine->loadTemplate(''), new \Handlebars\Context(), '', '');
}
public function testInvalidHelperMustacheStyle()
{
$this->setExpectedException('RuntimeException');
$loader = new \Handlebars\Loader\StringLoader();
$engine = new \Handlebars\Handlebars(array('loader' => $loader));
$engine->render('{{#NOTVALID}}XXX{{/NOTVALID}}', array());
}
public function testInvalidHelper()
{
$this->setExpectedException('RuntimeException');