Added unit test for Mustache clone method.
This commit is contained in:
@@ -167,6 +167,25 @@ class MustacheTest extends PHPUnit_Framework_TestCase {
|
|||||||
$this->assertEquals($first, $second);
|
$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.
|
* Test everything in the `examples` directory.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user