diff --git a/tests/helpers_for_test.php b/tests/helpers_for_test.php index b80237b5..cd657458 100644 --- a/tests/helpers_for_test.php +++ b/tests/helpers_for_test.php @@ -41,4 +41,16 @@ function myif ($conditional, $options) { } } +function mywith ($context, $options) { + return $options['fn']($context); +} + +function myeach ($context, $options) { + $ret = ''; + foreach ($context as $cx) { + $ret .= $options['fn']($cx); + } + return $ret; +} + ?> diff --git a/tests/regressionTest.php b/tests/regressionTest.php index 3087124f..016b0990 100644 --- a/tests/regressionTest.php +++ b/tests/regressionTest.php @@ -322,6 +322,15 @@ public function issueProvider() ), 'expected' => 'NO', ), + + Array( + 'template' => '{{#mywith foo}}YA: {{name}}{{/mywith}}', + 'data' => Array('name' => 'OK?', 'foo' => Array('name' => 'OK!')), + 'options' => Array( + 'hbhelpers' => Array('mywith'), + ), + 'expected' => 'YA: OK!', + ), ); return array_map(function($i) {