Adding test for delimiter switching in partials

This commit is contained in:
KevBurnsJr
2011-06-12 17:20:03 -07:00
parent 27bed8f10a
commit 7d3f312b4c
+9
View File
@@ -148,6 +148,15 @@ class MustacheTest extends PHPUnit_Framework_TestCase {
$this->assertEquals('Zappa, Frank', $m->render('{{last_name}}, {{first_name}}', array('first_name' => 'Frank', 'last_name' => 'Zappa'))); $this->assertEquals('Zappa, Frank', $m->render('{{last_name}}, {{first_name}}', array('first_name' => 'Frank', 'last_name' => 'Zappa')));
} }
/**
* @group partials
*/
public function testRenderDelimitersInPartials() {
$m = new Mustache('{{>stache}}', null, array('stache' => '{{=<% %>=}}{{first_name}} {{last_name}}<%={{ }}=%>'));
$this->assertEquals('Charlie Chaplin', $m->render(null, array('first_name' => 'Charlie', 'last_name' => 'Chaplin')));
$this->assertEquals('{{first_name}} {{last_name}}', $m->render('{{last_name}}, {{first_name}}', array('first_name' => 'Frank', 'last_name' => 'Zappa')));
}
/** /**
* Mustache should allow newlines (and other whitespace) in comments and all other tags. * Mustache should allow newlines (and other whitespace) in comments and all other tags.
* *