mirror of
				https://github.com/Mibew/handlebars.php.git
				synced 2025-11-04 04:05:07 +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
 | 
			
		||||
        // no argument at all.
 | 
			
		||||
        try {
 | 
			
		||||
            $sectionVar = $context->get($sectionName, true);
 | 
			
		||||
            $sectionVar = $context->get($sectionName, false);
 | 
			
		||||
        } catch (\InvalidArgumentException $e) {
 | 
			
		||||
            throw new \RuntimeException(
 | 
			
		||||
                sprintf(
 | 
			
		||||
 | 
			
		||||
@ -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');
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user