瀏覽代碼

Added test for template retention in subsequent render invocations.

Justin Hileman 15 年之前
父節點
當前提交
f0ed2ad499
共有 1 個文件被更改,包括 17 次插入0 次删除
  1. 17 0
      test/MustacheTest.php

+ 17 - 0
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.
 	 *