Provide another interpolation failure test case.
This commit is contained in:
+20
-8
@@ -197,15 +197,27 @@ class MustacheTest extends PHPUnit_Framework_TestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @group partials
|
* @group interpolation
|
||||||
|
* @dataProvider interpolationData
|
||||||
*/
|
*/
|
||||||
public function testRenderDelimitersInSections() {
|
public function testDoubleRenderMustacheTags($template, $context, $expected) {
|
||||||
$m = new Mustache('{{#a}}{{=<% %>=}}{{b}} c<%={{ }}=%>{{/a}}');
|
$m = new Mustache($template, $context);
|
||||||
$this->assertEquals('{{b}} c', $m->render(null, array(
|
$this->assertEquals($expected, $m->render());
|
||||||
'a' => array(
|
}
|
||||||
array('b' => 'Do Not Render')
|
|
||||||
)
|
public function interpolationData() {
|
||||||
)));
|
return array(
|
||||||
|
array(
|
||||||
|
'{{#a}}{{=<% %>=}}{{b}} c<%={{ }}=%>{{/a}}',
|
||||||
|
array('a' => array(array('b' => 'Do Not Render'))),
|
||||||
|
'{{b}} c'
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'{{#a}}{{b}}{{/a}}',
|
||||||
|
array('a' => array('b' => '{{c}}'), 'c' => 'FAIL'),
|
||||||
|
'{{c}}'
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user