瀏覽代碼

Added unit test for Mustache clone method.

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

+ 19 - 0
test/MustacheTest.php

@@ -167,6 +167,25 @@ class MustacheTest extends PHPUnit_Framework_TestCase {
 		$this->assertEquals($first, $second);
 	}
 
+	/**
+	 * testClone function.
+	 *
+	 * @dataProvider getExamples
+	 * @access public
+	 * @return void
+	 */
+	public function testClone($class, $template, $output) {
+		$m = new $class;
+		$n = clone $m;
+
+		$n_output = $n->render($template);
+
+		$o = clone $n;
+
+		$this->assertEquals($m->render($template), $n_output);
+		$this->assertEquals($n_output, $o->render($template));
+	}
+
 	/**
 	 * Test everything in the `examples` directory.
 	 *