|
|
@@ -24,13 +24,13 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas
|
|
|
'foo' => '{{$baz}}default content{{/baz}}',
|
|
|
),
|
|
|
array(
|
|
|
- 'bar' => 'set by user'
|
|
|
+ 'bar' => 'set by user',
|
|
|
),
|
|
|
'{{< foo }}{{# bar }}{{$ baz }}{{/ baz }}{{/ bar }}{{/ foo }}',
|
|
|
),
|
|
|
array(
|
|
|
array(
|
|
|
- 'foo' => '{{$baz}}default content{{/baz}}'
|
|
|
+ 'foo' => '{{$baz}}default content{{/baz}}',
|
|
|
),
|
|
|
array(
|
|
|
),
|
|
|
@@ -39,19 +39,19 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas
|
|
|
array(
|
|
|
array(
|
|
|
'foo' => '{{$baz}}default content{{/baz}}',
|
|
|
- 'qux' => 'I am a partial'
|
|
|
+ 'qux' => 'I am a partial',
|
|
|
),
|
|
|
array(
|
|
|
),
|
|
|
- '{{<foo}}{{>qux}}{{$baz}}set by template{{/baz}}{{/foo}}'
|
|
|
+ '{{<foo}}{{>qux}}{{$baz}}set by template{{/baz}}{{/foo}}',
|
|
|
),
|
|
|
array(
|
|
|
array(
|
|
|
- 'foo' => '{{$baz}}default content{{/baz}}'
|
|
|
+ 'foo' => '{{$baz}}default content{{/baz}}',
|
|
|
),
|
|
|
array(),
|
|
|
- '{{<foo}}{{=<% %>=}}<%={{ }}=%>{{/foo}}'
|
|
|
- )
|
|
|
+ '{{<foo}}{{=<% %>=}}<%={{ }}=%>{{/foo}}',
|
|
|
+ ),
|
|
|
);
|
|
|
}
|
|
|
|
|
|
@@ -63,28 +63,28 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas
|
|
|
'foo' => '{{$baz}}default content{{/baz}}',
|
|
|
),
|
|
|
array(
|
|
|
- 'bar' => 'set by user'
|
|
|
+ 'bar' => 'set by user',
|
|
|
),
|
|
|
'{{<foo}}{{bar}}{{$baz}}override{{/baz}}{{/foo}}',
|
|
|
- 'override'
|
|
|
+ 'override',
|
|
|
),
|
|
|
array(
|
|
|
array(
|
|
|
- 'foo' => '{{$baz}}default content{{/baz}}'
|
|
|
+ 'foo' => '{{$baz}}default content{{/baz}}',
|
|
|
),
|
|
|
array(
|
|
|
),
|
|
|
'{{<foo}}{{! ignore me }}{{$baz}}set by template{{/baz}}{{/foo}}',
|
|
|
- 'set by template'
|
|
|
+ 'set by template',
|
|
|
),
|
|
|
array(
|
|
|
array(
|
|
|
- 'foo' => '{{$baz}}defualt content{{/baz}}'
|
|
|
+ 'foo' => '{{$baz}}defualt content{{/baz}}',
|
|
|
),
|
|
|
array(),
|
|
|
'{{<foo}}set by template{{$baz}}also set by template{{/baz}}{{/foo}}',
|
|
|
- 'also set by template'
|
|
|
- )
|
|
|
+ 'also set by template',
|
|
|
+ ),
|
|
|
);
|
|
|
}
|
|
|
|
|
|
@@ -102,7 +102,7 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas
|
|
|
$tpl = $this->mustache->loadTemplate('{{$foo}}default {{bar}} content{{/foo}}');
|
|
|
|
|
|
$data = array(
|
|
|
- 'bar' => 'baz'
|
|
|
+ 'bar' => 'baz',
|
|
|
);
|
|
|
|
|
|
$this->assertEquals('default baz content', $tpl->render($data));
|
|
|
@@ -113,7 +113,7 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas
|
|
|
$tpl = $this->mustache->loadTemplate('{{$foo}}default {{{bar}}} content{{/foo}}');
|
|
|
|
|
|
$data = array(
|
|
|
- 'bar' => '<baz>'
|
|
|
+ 'bar' => '<baz>',
|
|
|
);
|
|
|
|
|
|
$this->assertEquals('default <baz> content', $tpl->render($data));
|
|
|
@@ -126,7 +126,7 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas
|
|
|
);
|
|
|
|
|
|
$data = array(
|
|
|
- 'bar' => array('baz' => 'qux')
|
|
|
+ 'bar' => array('baz' => 'qux'),
|
|
|
);
|
|
|
|
|
|
$this->assertEquals('default qux content', $tpl->render($data));
|
|
|
@@ -140,7 +140,7 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas
|
|
|
|
|
|
$data = array(
|
|
|
'foo' => array('bar' => 'qux'),
|
|
|
- 'baz' => 'three'
|
|
|
+ 'baz' => 'three',
|
|
|
);
|
|
|
|
|
|
$this->assertEquals('default three content', $tpl->render($data));
|
|
|
@@ -153,7 +153,7 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas
|
|
|
);
|
|
|
|
|
|
$data = array(
|
|
|
- 'bar' => array('baz' => '{{qux}}')
|
|
|
+ 'bar' => array('baz' => '{{qux}}'),
|
|
|
);
|
|
|
|
|
|
$this->assertEquals('default {{qux}} content', $tpl->render($data));
|
|
|
@@ -162,7 +162,7 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas
|
|
|
public function testDefaultContentRenderedInsideIncludedTemplates()
|
|
|
{
|
|
|
$partials = array(
|
|
|
- 'include' => '{{$foo}}default content{{/foo}}'
|
|
|
+ 'include' => '{{$foo}}default content{{/foo}}',
|
|
|
);
|
|
|
|
|
|
$this->mustache->setPartials($partials);
|
|
|
@@ -179,7 +179,7 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas
|
|
|
public function testOverriddenContent()
|
|
|
{
|
|
|
$partials = array(
|
|
|
- 'super' => '...{{$title}}Default title{{/title}}...'
|
|
|
+ 'super' => '...{{$title}}Default title{{/title}}...',
|
|
|
);
|
|
|
|
|
|
$this->mustache->setPartials($partials);
|
|
|
@@ -196,7 +196,7 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas
|
|
|
public function testOverriddenPartial()
|
|
|
{
|
|
|
$partials = array(
|
|
|
- 'partial' => '|{{$stuff}}...{{/stuff}}{{$default}} default{{/default}}|'
|
|
|
+ 'partial' => '|{{$stuff}}...{{/stuff}}{{$default}} default{{/default}}|',
|
|
|
);
|
|
|
|
|
|
$this->mustache->setPartials($partials);
|
|
|
@@ -213,7 +213,7 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas
|
|
|
public function testDataDoesNotOverrideBlock()
|
|
|
{
|
|
|
$partials = array(
|
|
|
- 'include' => '{{$var}}var in include{{/var}}'
|
|
|
+ 'include' => '{{$var}}var in include{{/var}}',
|
|
|
);
|
|
|
|
|
|
$this->mustache->setPartials($partials);
|
|
|
@@ -223,7 +223,7 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas
|
|
|
);
|
|
|
|
|
|
$data = array(
|
|
|
- 'var' => 'var in data'
|
|
|
+ 'var' => 'var in data',
|
|
|
);
|
|
|
|
|
|
$this->assertEquals('var in template', $tpl->render($data));
|
|
|
@@ -232,7 +232,7 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas
|
|
|
public function testDataDoesNotOverrideDefaultBlockValue()
|
|
|
{
|
|
|
$partials = array(
|
|
|
- 'include' => '{{$var}}var in include{{/var}}'
|
|
|
+ 'include' => '{{$var}}var in include{{/var}}',
|
|
|
);
|
|
|
|
|
|
$this->mustache->setPartials($partials);
|
|
|
@@ -242,7 +242,7 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas
|
|
|
);
|
|
|
|
|
|
$data = array(
|
|
|
- 'var' => 'var in data'
|
|
|
+ 'var' => 'var in data',
|
|
|
);
|
|
|
|
|
|
$this->assertEquals('var in include', $tpl->render($data));
|
|
|
@@ -251,7 +251,7 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas
|
|
|
public function testOverridePartialWithNewlines()
|
|
|
{
|
|
|
$partials = array(
|
|
|
- 'partial' => '{{$ballmer}}peaking{{/ballmer}}'
|
|
|
+ 'partial' => '{{$ballmer}}peaking{{/ballmer}}',
|
|
|
);
|
|
|
|
|
|
$this->mustache->setPartials($partials);
|
|
|
@@ -270,7 +270,7 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas
|
|
|
$partials = array(
|
|
|
'partial' =>
|
|
|
'stop:
|
|
|
- {{$nineties}}collaborate and listen{{/nineties}}'
|
|
|
+ {{$nineties}}collaborate and listen{{/nineties}}',
|
|
|
);
|
|
|
|
|
|
$this->mustache->setPartials($partials);
|
|
|
@@ -291,7 +291,7 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas
|
|
|
public function testOverrideOneSubstitutionButNotTheOther()
|
|
|
{
|
|
|
$partials = array(
|
|
|
- 'partial' => '{{$stuff}}default one{{/stuff}}, {{$stuff2}}default two{{/stuff2}}'
|
|
|
+ 'partial' => '{{$stuff}}default one{{/stuff}}, {{$stuff2}}default two{{/stuff2}}',
|
|
|
);
|
|
|
|
|
|
$this->mustache->setPartials($partials);
|
|
|
@@ -308,7 +308,7 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas
|
|
|
public function testSuperTemplatesWithNoParameters()
|
|
|
{
|
|
|
$partials = array(
|
|
|
- 'include' => '{{$foo}}default content{{/foo}}'
|
|
|
+ 'include' => '{{$foo}}default content{{/foo}}',
|
|
|
);
|
|
|
|
|
|
$this->mustache->setPartials($partials);
|
|
|
@@ -326,7 +326,7 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas
|
|
|
{
|
|
|
$partials = array(
|
|
|
'include' => '{{$foo}}default content{{/foo}} {{$bar}}{{<include2}}{{/include2}}{{/bar}}',
|
|
|
- 'include2' => '{{$foo}}include2 default content{{/foo}} {{<include}}{{$bar}}don\'t recurse{{/bar}}{{/include}}'
|
|
|
+ 'include2' => '{{$foo}}include2 default content{{/foo}} {{<include}}{{$bar}}don\'t recurse{{/bar}}{{/include}}',
|
|
|
);
|
|
|
|
|
|
$this->mustache->setPartials($partials);
|
|
|
@@ -345,7 +345,7 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas
|
|
|
$partials = array(
|
|
|
'parent' => '{{<older}}{{$a}}p{{/a}}{{/older}}',
|
|
|
'older' => '{{<grandParent}}{{$a}}o{{/a}}{{/grandParent}}',
|
|
|
- 'grandParent' => '{{$a}}g{{/a}}'
|
|
|
+ 'grandParent' => '{{$a}}g{{/a}}',
|
|
|
);
|
|
|
|
|
|
$this->mustache->setPartials($partials);
|
|
|
@@ -364,7 +364,7 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas
|
|
|
$partials = array(
|
|
|
'parent' => '{{<older}}{{$a}}p{{/a}}{{/older}}',
|
|
|
'older' => '{{<grandParent}}{{$a}}o{{/a}}{{/grandParent}}',
|
|
|
- 'grandParent' => '{{$a}}g{{/a}}'
|
|
|
+ 'grandParent' => '{{$a}}g{{/a}}',
|
|
|
);
|
|
|
|
|
|
$this->mustache->setPartials($partials);
|
|
|
@@ -381,7 +381,7 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas
|
|
|
public function testIgnoreTextInsideSuperTemplatesButParseArgs()
|
|
|
{
|
|
|
$partials = array(
|
|
|
- 'include' => '{{$foo}}default content{{/foo}}'
|
|
|
+ 'include' => '{{$foo}}default content{{/foo}}',
|
|
|
);
|
|
|
|
|
|
$this->mustache->setPartials($partials);
|
|
|
@@ -398,7 +398,7 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas
|
|
|
public function testIgnoreTextInsideSuperTemplates()
|
|
|
{
|
|
|
$partials = array(
|
|
|
- 'include' => '{{$foo}}default content{{/foo}}'
|
|
|
+ 'include' => '{{$foo}}default content{{/foo}}',
|
|
|
);
|
|
|
|
|
|
$this->mustache->setPartials($partials);
|