Per the spec, missing partials should be treated as an empty string.

This commit is contained in:
Justin Hileman
2012-03-24 20:45:39 -07:00
parent b7a6ff2433
commit 99a5e9b14a
3 changed files with 21 additions and 2 deletions
+11
View File
@@ -146,6 +146,17 @@ class Mustache_Test_MustacheTest extends PHPUnit_Framework_TestCase {
$mustache->setPartials(array('foo' => '{{ foo }}'));
}
public function testMissingPartialsTreatedAsEmptyString() {
$mustache = new Mustache_Mustache(array(
'partials_loader' => new Mustache_Loader_ArrayLoader(array(
'foo' => 'FOO',
'baz' => 'BAZ',
))
));
$this->assertEquals('FOOBAZ', $mustache->render('{{>foo}}{{>bar}}{{>baz}}', array()));
}
public function testHelpers() {
$foo = function() { return 'foo'; };
$bar = 'BAR';