From f0ed2ad49951b06a331b9c275c55070660e1f4d1 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Mon, 24 May 2010 10:29:43 -0400 Subject: [PATCH] Added test for template retention in subsequent render invocations. --- test/MustacheTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/MustacheTest.php b/test/MustacheTest.php index 06e1874..8758a66 100644 --- a/test/MustacheTest.php +++ b/test/MustacheTest.php @@ -167,6 +167,23 @@ class MustacheTest extends PHPUnit_Framework_TestCase { $this->assertEquals($first, $second); } + + /** + * Mustache should not use templates passed to the render() method for subsequent invocations. + * + * @access public + * @return void + */ + public function testResetTemplateForMultipleInvocations() { + $m = new Mustache('Sirve.'); + $m->render('No sirve.'); + $this->assertEquals('Sirve.', $m->render()); + + $m2 = new Mustache(); + $m2->render('No sirve.'); + $this->assertEquals('', $m2->render()); + } + /** * Test everything in the `examples` directory. *