diff --git a/test/MustacheTest.php b/test/MustacheTest.php index f4d9672..06e1874 100644 --- a/test/MustacheTest.php +++ b/test/MustacheTest.php @@ -137,6 +137,36 @@ class MustacheTest extends PHPUnit_Framework_TestCase { $this->assertEquals('Zappa, Frank', $m->render('{{last_name}}, {{first_name}}', array('first_name' => 'Frank', 'last_name' => 'Zappa'))); } + /** + * Mustache should return the same thing when invoked multiple times. + * + * @access public + * @return void + */ + public function testMultipleInvocations() { + $m = new Mustache('x'); + $first = $m->render(); + $second = $m->render(); + + $this->assertEquals('x', $first); + $this->assertEquals($first, $second); + } + + /** + * Mustache should return the same thing when invoked multiple times. + * + * @access public + * @return void + */ + public function testMultipleInvocationsWithTags() { + $m = new Mustache('{{one}} {{two}}', array('one' => 'foo', 'two' => 'bar')); + $first = $m->render(); + $second = $m->render(); + + $this->assertEquals('foo bar', $first); + $this->assertEquals($first, $second); + } + /** * Test everything in the `examples` directory. *