Add a failing test for #286
This commit is contained in:
@@ -33,6 +33,36 @@ EOS;
|
||||
<input placeholder="ENTER YOUR NAME">
|
||||
</fieldset>
|
||||
|
||||
EOS;
|
||||
|
||||
$m = new Mustache_Engine(array(
|
||||
'partials' => array('input' => $partial),
|
||||
));
|
||||
|
||||
$tpl = $m->loadTemplate($src);
|
||||
|
||||
$data = new Mustache_Test_FiveThree_Functional_ClassWithLambda();
|
||||
$this->assertEquals($expected, $tpl->render($data));
|
||||
}
|
||||
|
||||
public function testLambdaInterpolationsInsidePartialsAreIndentedProperly()
|
||||
{
|
||||
$src = <<<EOS
|
||||
<fieldset>
|
||||
{{> input }}
|
||||
</fieldset>
|
||||
|
||||
EOS;
|
||||
$partial = <<<EOS
|
||||
<input placeholder="{{ placeholder }}">
|
||||
|
||||
EOS;
|
||||
|
||||
$expected = <<<EOS
|
||||
<fieldset>
|
||||
<input placeholder="Enter your name">
|
||||
</fieldset>
|
||||
|
||||
EOS;
|
||||
|
||||
$m = new Mustache_Engine(array(
|
||||
@@ -54,4 +84,11 @@ class Mustache_Test_FiveThree_Functional_ClassWithLambda
|
||||
return strtoupper($val);
|
||||
};
|
||||
}
|
||||
|
||||
public function placeholder()
|
||||
{
|
||||
return function() {
|
||||
return 'Enter your name';
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user