mirror of
https://github.com/Mibew/handlebars.php.git
synced 2025-05-03 10:33:08 +03:00
Merge pull request #121 from mmontagna/master
Fixes a incompatibility with handlebars.js
This commit is contained in:
commit
f3067cb41a
@ -404,7 +404,7 @@ class Template
|
|||||||
// fallback to mustache style each/with/for just if there is
|
// fallback to mustache style each/with/for just if there is
|
||||||
// no argument at all.
|
// no argument at all.
|
||||||
try {
|
try {
|
||||||
$sectionVar = $context->get($sectionName, true);
|
$sectionVar = $context->get($sectionName, false);
|
||||||
} catch (\InvalidArgumentException $e) {
|
} catch (\InvalidArgumentException $e) {
|
||||||
throw new \RuntimeException(
|
throw new \RuntimeException(
|
||||||
sprintf(
|
sprintf(
|
||||||
|
@ -454,14 +454,6 @@ class HandlebarsTest extends \PHPUnit_Framework_TestCase
|
|||||||
$engine->getHelpers()->call('invalid', $engine->loadTemplate(''), new \Handlebars\Context(), '', '');
|
$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()
|
public function testInvalidHelper()
|
||||||
{
|
{
|
||||||
$this->setExpectedException('RuntimeException');
|
$this->setExpectedException('RuntimeException');
|
||||||
|
Loading…
Reference in New Issue
Block a user