Merge branch 'feature/fix-partials' into dev

This commit is contained in:
Justin Hileman
2010-05-24 10:35:00 -04:00
13 changed files with 165 additions and 93 deletions
+6
View File
@@ -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}}}'));
}
}
+23
View File
@@ -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.
*