From 131cad6024515158006dd2942e89f6ad82322aa7 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Sat, 13 Feb 2016 15:36:35 -0800 Subject: [PATCH] Add a failing test for #286 --- .../Functional/PartialLambdaIndentTest.php | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/test/Mustache/Test/FiveThree/Functional/PartialLambdaIndentTest.php b/test/Mustache/Test/FiveThree/Functional/PartialLambdaIndentTest.php index 1ed93b6..c96a9fd 100644 --- a/test/Mustache/Test/FiveThree/Functional/PartialLambdaIndentTest.php +++ b/test/Mustache/Test/FiveThree/Functional/PartialLambdaIndentTest.php @@ -33,6 +33,36 @@ EOS; +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 = << + {{> input }} + + +EOS; + $partial = << + +EOS; + + $expected = << + + + 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'; + }; + } }