mirror of
				https://github.com/Mibew/handlebars.php.git
				synced 2025-11-04 04:05:07 +03:00 
			
		
		
		
	Update HandlebarsTest.php
Test that check if the if and unless helpers comply with handlebars.js
This commit is contained in:
		
							parent
							
								
									3710a50e41
								
							
						
					
					
						commit
						4e81464c30
					
				@ -961,4 +961,16 @@ class HandlebarsTest extends \PHPUnit_Framework_TestCase
 | 
			
		||||
        $engine = new \Handlebars\Handlebars();
 | 
			
		||||
        //$engine->set
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     * Test if and unless adding an extra layer when accessing parent
 | 
			
		||||
     */
 | 
			
		||||
    public function testIfUnlessExtraLayer()
 | 
			
		||||
    {
 | 
			
		||||
        $loader = new \Handlebars\Loader\StringLoader();
 | 
			
		||||
        $engine = new \Handlebars\Handlebars(array('loader' => $loader));
 | 
			
		||||
        
 | 
			
		||||
        $this->assertEquals('good', $engine->render('{{#with b}}{{#if this}}{{../../a}}{{/if}}{{/with}}', array('a' => 'good', 'b' => 'stump')));
 | 
			
		||||
        $this->assertEquals('good', $engine->render('{{#with b}}{{#if unless}}{{else}}{{../../a}}{{/if}}{{/with}}', array('a' => 'good', 'b' => 'stump')));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user