mustache = new Mustache_Engine(); } public function testSectionLambdaHelper() { $one = $this->mustache->loadTemplate('{{name}}'); $two = $this->mustache->loadTemplate('{{#lambda}}{{name}}{{/lambda}}'); $foo = new StdClass(); $foo->name = 'Mario'; $foo->lambda = function ($text, $mustache) { return strtoupper($mustache->render($text)); }; $this->assertEquals('Mario', $one->render($foo)); $this->assertEquals('MARIO', $two->render($foo)); } }