From 5ade8a5ee3686894f0df2a5acdcef69fb1269d99 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Sat, 22 May 2010 20:41:12 -0400 Subject: [PATCH] Added unit test for Mustache clone method. --- test/MustacheTest.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/MustacheTest.php b/test/MustacheTest.php index 06e1874..1936c4a 100644 --- a/test/MustacheTest.php +++ b/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. *