Merge branch 'feature/fix-partials' into dev
This commit is contained in:
@@ -39,4 +39,10 @@ class MustachePragmaTest extends PHPUnit_Framework_TestCase {
|
||||
$this->assertEquals("1\n23", $m->render("1\n2{{%DOT-NOTATION}}\n3"), 'Wrong newline removed with pragma tag');
|
||||
}
|
||||
|
||||
public function testPragmaReset() {
|
||||
$m = new Mustache('', array('symbol' => '>>>'));
|
||||
$this->assertEquals('>>>', $m->render('{{{symbol}}}'));
|
||||
$this->assertEquals('>>>', $m->render('{{%UNESCAPED}}{{symbol}}'));
|
||||
$this->assertEquals('>>>', $m->render('{{{symbol}}}'));
|
||||
}
|
||||
}
|
||||
@@ -184,6 +184,29 @@ class MustacheTest extends PHPUnit_Framework_TestCase {
|
||||
$this->assertEquals('', $m2->render());
|
||||
}
|
||||
|
||||
/**
|
||||
* testClone function.
|
||||
*
|
||||
* @dataProvider getExamples
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function test__clone($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));
|
||||
|
||||
$this->assertNotSame($m, $n);
|
||||
$this->assertNotSame($n, $o);
|
||||
$this->assertNotSame($m, $o);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test everything in the `examples` directory.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user