From a4e6d6d609635ca9017a6121f3c8c15c0489eff2 Mon Sep 17 00:00:00 2001 From: uwetews Date: Sun, 27 Dec 2015 05:05:54 +0100 Subject: [PATCH] Update {block} {extends} test --- .../BockExtend/CompileBlockExtendsTest.php | 788 +++++++++++------- .../BockExtend/templates/001_parent.tpl | 2 +- .../BockExtend/templates/002_child.tpl | 2 +- .../BockExtend/templates/002_parent.tpl | 2 +- .../BockExtend/templates/003_child.tpl | 2 + .../templates/003_child_prepend.tpl | 2 - .../BockExtend/templates/003_grand.tpl | 2 + .../BockExtend/templates/003_parent.tpl | 3 +- .../BockExtend/templates/004_child.tpl | 2 + .../BockExtend/templates/004_child_append.tpl | 2 - .../BockExtend/templates/004_grand.tpl | 2 + .../BockExtend/templates/004_grand2.tpl | 2 + .../BockExtend/templates/004_parent.tpl | 2 +- .../BockExtend/templates/005_child.tpl | 2 + .../templates/005_child_append_shorttag.tpl | 2 - .../BockExtend/templates/005_parent.tpl | 2 + .../templates/005_parent_shorttag.tpl | 2 - .../BockExtend/templates/006_child.tpl | 2 + .../templates/006_child_smartychild.tpl | 3 - .../BockExtend/templates/006_parent.tpl | 2 + .../templates/006_parent_smartychild.tpl | 2 - .../BockExtend/templates/007_child.tpl | 2 + .../templates/007_child_smartyparent.tpl | 2 - .../BockExtend/templates/007_grand.tpl | 2 + .../BockExtend/templates/007_parent.tpl | 2 +- .../BockExtend/templates/008_child.tpl | 2 + .../BockExtend/templates/008_child_plugin.tpl | 2 - .../BockExtend/templates/008_parent.tpl | 2 +- .../BockExtend/templates/009_parent.tpl | 2 + .../templates/009_parent_nested.tpl | 2 - .../BockExtend/templates/010_child.tpl | 2 + .../BockExtend/templates/010_child_nested.tpl | 2 - .../BockExtend/templates/010_parent.tpl | 2 + .../templates/010_parent_nested.tpl | 2 - .../BockExtend/templates/011_child.tpl | 12 + .../templates/011_child_nested_include.tpl | 4 - .../BockExtend/templates/011_grand.tpl | 5 + .../011_grandchild_nested_include.tpl | 2 - .../BockExtend/templates/011_include.tpl | 1 + .../BockExtend/templates/011_parent.tpl | 2 + .../templates/011_parent_nested_include.tpl | 2 - .../BockExtend/templates/012_child.tpl | 2 +- .../BockExtend/templates/012_grand.tpl | 2 + .../BockExtend/templates/012_grandchild.tpl | 2 - .../BockExtend/templates/012_grandgrand.tpl | 2 + .../BockExtend/templates/012_parent.tpl | 2 +- .../templates/013_2_child_prepend.tpl | 2 - .../templates/013_2_grandchild_prepend.tpl | 2 - .../BockExtend/templates/013_child.tpl | 2 - .../templates/013_grandchild_prepend.tpl | 2 - .../BockExtend/templates/013_parent.tpl | 2 - .../templates/014_child_smartychild.tpl | 2 - .../templates/014_grandchild_smartychild.tpl | 2 - .../BockExtend/templates/014_parent.tpl | 2 - .../BockExtend/templates/015_child.tpl | 2 - .../templates/015_grandchild_append.tpl | 2 - .../BockExtend/templates/015_parent.tpl | 2 - .../BockExtend/templates/016_child_nested.tpl | 2 - .../templates/016_grandchild_nested.tpl | 2 - .../BockExtend/templates/016_parent.tpl | 2 - .../BockExtend/templates/017_child_nested.tpl | 6 - .../templates/017_grandchild_nested.tpl | 2 - .../BockExtend/templates/017_parent.tpl | 2 - .../BockExtend/templates/018_child.tpl | 9 + .../templates/018_child_nested_hide.tpl | 12 - .../BockExtend/templates/018_grand.tpl | 6 + .../BockExtend/templates/018_grandgrand.tpl | 6 + .../BockExtend/templates/018_parent.tpl | 2 + .../templates/018_parent_nested.tpl | 2 - .../019_child_nested_hide_autoliteral.tpl | 12 - .../BockExtend/templates/019_parent.tpl | 2 - .../BockExtend/templates/020_include_1.tpl | 4 +- .../BockExtend/templates/020_include_2.tpl | 4 +- .../BockExtend/templates/020_include_3.tpl | 4 +- .../templates/020_include_parent.tpl | 1 + .../BockExtend/templates/020_include_root.tpl | 6 +- .../BockExtend/templates/021_child.tpl | 2 +- .../BockExtend/templates/021_grand.tpl | 2 + .../BockExtend/templates/021_grandchild.tpl | 2 - .../BockExtend/templates/021_parent.tpl | 2 +- 80 files changed, 573 insertions(+), 437 deletions(-) create mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/003_child.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/003_child_prepend.tpl create mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/003_grand.tpl create mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/004_child.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/004_child_append.tpl create mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/004_grand.tpl create mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/004_grand2.tpl create mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/005_child.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/005_child_append_shorttag.tpl create mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/005_parent.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/005_parent_shorttag.tpl create mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/006_child.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/006_child_smartychild.tpl create mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/006_parent.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/006_parent_smartychild.tpl create mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/007_child.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/007_child_smartyparent.tpl create mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/007_grand.tpl create mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/008_child.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/008_child_plugin.tpl create mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/009_parent.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/009_parent_nested.tpl create mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/010_child.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/010_child_nested.tpl create mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/010_parent.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/010_parent_nested.tpl create mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/011_child.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/011_child_nested_include.tpl create mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/011_grand.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/011_grandchild_nested_include.tpl create mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/011_include.tpl create mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/011_parent.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/011_parent_nested_include.tpl create mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/012_grand.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/012_grandchild.tpl create mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/012_grandgrand.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/013_2_child_prepend.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/013_2_grandchild_prepend.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/013_child.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/013_grandchild_prepend.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/013_parent.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/014_child_smartychild.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/014_grandchild_smartychild.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/014_parent.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/015_child.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/015_grandchild_append.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/015_parent.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/016_child_nested.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/016_grandchild_nested.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/016_parent.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/017_child_nested.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/017_grandchild_nested.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/017_parent.tpl create mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/018_child.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/018_child_nested_hide.tpl create mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/018_grand.tpl create mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/018_grandgrand.tpl create mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/018_parent.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/018_parent_nested.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/019_child_nested_hide_autoliteral.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/019_parent.tpl create mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/021_grand.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/021_grandchild.tpl diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/CompileBlockExtendsTest.php b/tests/UnitTests/TemplateSource/TagTests/BockExtend/CompileBlockExtendsTest.php index 53d51de9..1b94dddf 100644 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/CompileBlockExtendsTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/CompileBlockExtendsTest.php @@ -10,7 +10,7 @@ * class for block extends compiler tests * * @runTestsInSeparateProcess - * @preserveGlobalState disabled + * @preserveGlobalState disabled * @backupStaticAttributes enabled */ class CompileBlockExtendsTest extends PHPUnit_Smarty @@ -21,7 +21,6 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty //$this->smarty->setMergeCompiledIncludes(true); } - public function compiledPrefilter($text, Smarty_Internal_Template $tpl) { return str_replace('#', $tpl->getTemplateVars('test'), $text); @@ -31,6 +30,7 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty { $this->cleanDirs(); } + /** * test block default outout */ @@ -52,554 +52,684 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty */ public function testCompileBlockParent_001() { + $this->smarty->assign('parent', 'parent'); $result = $this->smarty->fetch('001_parent.tpl'); - $this->assertContains('Default Title', $result); + $this->assertContains('(parent|b)content parent b(parent|/b)', $result); } /** * test child/parent template chain + * * @runInSeparateProcess * @preserveGlobalState disabled - * @dataProvider data + * @dataProvider data */ - public function testCompileBlockChild_002($caching, $merge, $testNumber, $compileTestNumber, $renderTestNumber, $testName) + public function testCompileBlockChild_002($caching, $merge, $testNumber, $compileTestNumber, $renderTestNumber, + $testName) { $this->smarty->registerFilter('pre', array($this, 'compiledPrefilter')); $this->smarty->assign('test', $testNumber); - $this->smarty->caching = $caching; - $this->smarty->merge_compiled_includes = $merge; + $this->smarty->assign('parent', 'parent', true); + $this->smarty->assign('child', 'child', true); + $this->smarty->setCaching($caching); + $this->smarty->setMergeCompiledIncludes($merge); if ($merge) { - $this->smarty->compile_id = 1; + $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('002_child.tpl'); - $this->assertContains('Page Title', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); + $this->assertContains('(child|b)content child b(child|/b)', $result, $testName . ' - content'); + $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $testName . ' - fetch() failure'); } /** * test child/parent template chain with prepend + * * @runInSeparateProcess * @preserveGlobalState disabled - * @dataProvider data + * @dataProvider data */ - public function testCompileBlockChildPrepend_003($caching, $merge, $testNumber, $compileTestNumber, $renderTestNumber, $testName) + public function testCompileBlockChildPrepend_003($caching, $merge, $testNumber, $compileTestNumber, + $renderTestNumber, $testName) { $this->smarty->registerFilter('pre', array($this, 'compiledPrefilter')); $this->smarty->assign('test', $testNumber); - $this->smarty->caching = $caching; - $this->smarty->merge_compiled_includes = $merge; + $this->smarty->assign('parent', 'parent', true); + $this->smarty->assign('child', 'child', true); + $this->smarty->setCaching($caching); + $this->smarty->setMergeCompiledIncludes($merge); if ($merge) { - $this->smarty->compile_id = 1; + $this->smarty->setCompileId(1); } - $result = $this->smarty->fetch('003_child_prepend.tpl'); - $this->assertContains("prepend - Default Title", $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); + $result = $this->smarty->fetch('003_child.tpl'); + $this->assertContains('(child|b)content child b(child|/b)(parent|b)content parent b(parent|/b)', $result, + $testName . ' - content'); + $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $testName . ' - fetch() failure'); + } + + /** + * test child/parent template chain with prepend + * + * @runInSeparateProcess + * @preserveGlobalState disabled + * @dataProvider data + */ + public function testCompileBlockGrandPrepend_003($caching, $merge, $testNumber, $compileTestNumber, + $renderTestNumber, $testName) + { + $this->smarty->registerFilter('pre', array($this, 'compiledPrefilter')); + $this->smarty->assign('test', $testNumber); + $this->smarty->assign('parent', 'parent', true); + $this->smarty->assign('child', 'child', true); + $this->smarty->assign('grand', 'grand', true); + $this->smarty->setCaching($caching); + $this->smarty->setMergeCompiledIncludes($merge); + if ($merge) { + $this->smarty->setCompileId(1); + } + $result = $this->smarty->fetch('003_grand.tpl'); + $this->assertContains('(grand|b)content grand b(grand|/b)(child|b)content child b(child|/b)(parent|b)content parent b(parent|/b)', + $result, $testName . ' - content'); + $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $testName . ' - fetch() failure'); } /** * test child/parent template chain with apppend + * * @runInSeparateProcess * @preserveGlobalState disabled - * @dataProvider data + * @dataProvider data */ - public function testCompileBlockChildAppend_004($caching, $merge, $testNumber, $compileTestNumber, $renderTestNumber, $testName) + public function testCompileBlockChildAppend_004($caching, $merge, $testNumber, $compileTestNumber, + $renderTestNumber, $testName) { $this->smarty->registerFilter('pre', array($this, 'compiledPrefilter')); $this->smarty->assign('test', $testNumber); - $this->smarty->caching = $caching; - $this->smarty->merge_compiled_includes = $merge; + $this->smarty->assign('parent', 'parent', true); + $this->smarty->assign('child', 'child', true); + $this->smarty->assign('grand', 'grand', true); + $this->smarty->setCaching($caching); + $this->smarty->setMergeCompiledIncludes($merge); if ($merge) { - $this->smarty->compile_id = 1; + $this->smarty->setCompileId(1); } - $result = $this->smarty->fetch('004_child_append.tpl'); - $this->assertContains("Default Title - append", $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); + $result = $this->smarty->fetch('004_child.tpl'); + $this->assertContains('(parent|b)content parent b(parent|/b)(child|b)content child b(child|/b)', $result, + $testName . ' - content'); + $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $testName . ' - fetch() failure'); + } + + /** + * test grandchild/parent template chain with apppend + * + * @runInSeparateProcess + * @preserveGlobalState disabled + * @dataProvider data + */ + public function testCompileBlockGrandAppend_004($caching, $merge, $testNumber, $compileTestNumber, + $renderTestNumber, $testName) + { + $this->smarty->registerFilter('pre', array($this, 'compiledPrefilter')); + $this->smarty->assign('test', $testNumber); + $this->smarty->assign('parent', 'parent', true); + $this->smarty->assign('child', 'child', true); + $this->smarty->assign('grand', 'grand', true); + $this->smarty->setCaching($caching); + $this->smarty->setMergeCompiledIncludes($merge); + if ($merge) { + $this->smarty->setCompileId(1); + } + $result = $this->smarty->fetch('004_grand.tpl'); + $this->assertContains('(parent|b)content parent b(parent|/b)(child|b)content child b(child|/b)(grand|b)content grand b(grand|/b)', + $result, $testName . ' - content'); + $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $testName . ' - fetch() failure'); + } + + /** + * test grandchild/parent template chain with apppend + * + * @runInSeparateProcess + * @preserveGlobalState disabled + * @dataProvider data + */ + public function testCompileBlockGrandAppendPrepend_004($caching, $merge, $testNumber, $compileTestNumber, + $renderTestNumber, $testName) + { + $this->smarty->registerFilter('pre', array($this, 'compiledPrefilter')); + $this->smarty->assign('test', $testNumber); + $this->smarty->assign('parent', 'parent', true); + $this->smarty->assign('child', 'child', true); + $this->smarty->assign('grand', 'grand', true); + $this->smarty->setCaching($caching); + $this->smarty->setMergeCompiledIncludes($merge); + if ($merge) { + $this->smarty->setCompileId(1); + } + $result = $this->smarty->fetch('004_grand2.tpl'); + $this->assertContains('(parent|b)content parent b(parent|/b)(grand|b)content grand b(grand|/b)(child|b)content child b(child|/b)(grand|b)content grand b(grand|/b)', + $result, $testName . ' - content'); + $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $testName . ' - fetch() failure'); } /** * test child/parent template chain with apppend and shorttags + * * @runInSeparateProcess * @preserveGlobalState disabled - * @dataProvider data + * @dataProvider data */ - public function testCompileBlockChildAppendShortag_005($caching, $merge, $testNumber, $compileTestNumber, $renderTestNumber, $testName) + public function testCompileBlockChildAppendShortag_005($caching, $merge, $testNumber, $compileTestNumber, + $renderTestNumber, $testName) { $this->smarty->registerFilter('pre', array($this, 'compiledPrefilter')); $this->smarty->assign('test', $testNumber); - $this->smarty->caching = $caching; - $this->smarty->merge_compiled_includes = $merge; + $this->smarty->assign('parent', 'parent', true); + $this->smarty->assign('child', 'child', true); + $this->smarty->setCaching($caching); + $this->smarty->setMergeCompiledIncludes($merge); if ($merge) { - $this->smarty->compile_id = 1; + $this->smarty->setCompileId(1); } - $result = $this->smarty->fetch('005_child_append_shorttag.tpl'); - $this->assertContains("Default Title - append", $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); + $result = $this->smarty->fetch('005_child.tpl'); + $this->assertContains('(parent|b)content parent b(parent|/b)(child|b)content child b(child|/b)', $result, + $testName . ' - content'); + $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $testName . ' - fetch() failure'); } /** * test child/parent template chain with {$this->smarty.block.child) + * * @runInSeparateProcess * @preserveGlobalState disabled - * @dataProvider data + * @dataProvider data */ - public function testCompileBlockChildSmartyChild_006($caching, $merge, $testNumber, $compileTestNumber, $renderTestNumber, $testName) + public function testCompileBlockChildSmartyChild_006($caching, $merge, $testNumber, $compileTestNumber, + $renderTestNumber, $testName) { $this->smarty->registerFilter('pre', array($this, 'compiledPrefilter')); $this->smarty->assign('test', $testNumber); - $this->smarty->caching = $caching; - $this->smarty->merge_compiled_includes = $merge; + $this->smarty->assign('parent', 'parent', true); + $this->smarty->assign('child', 'child', true); + $this->smarty->setCaching($caching); + $this->smarty->setMergeCompiledIncludes($merge); if ($merge) { - $this->smarty->compile_id = 1; + $this->smarty->setCompileId(1); } - $result = $this->smarty->fetch('006_child_smartychild.tpl'); - $this->assertContains('here is >child text< included', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); + $result = $this->smarty->fetch('006_child.tpl'); + $this->assertContains('(parent|b)content (child|b)content child b(child|/b) b(parent|/b)', $result, + $testName . ' - content'); + $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $testName . ' - fetch() failure'); } /** * test child/parent template chain with {$this->smarty.block.parent) + * * @runInSeparateProcess * @preserveGlobalState disabled - * @dataProvider data + * @dataProvider data */ - public function testCompileBlockChildSmartyParent_007($caching, $merge, $testNumber, $compileTestNumber, $renderTestNumber, $testName) + public function testCompileBlockChildSmartyParent_007($caching, $merge, $testNumber, $compileTestNumber, + $renderTestNumber, $testName) { $this->smarty->registerFilter('pre', array($this, 'compiledPrefilter')); $this->smarty->assign('test', $testNumber); - $this->smarty->caching = $caching; - $this->smarty->merge_compiled_includes = $merge; + $this->smarty->assign('parent', 'parent', true); + $this->smarty->assign('child', 'child', true); + $this->smarty->assign('grand', 'grand', true); + $this->smarty->setCaching($caching); + $this->smarty->setMergeCompiledIncludes($merge); if ($merge) { - $this->smarty->compile_id = 1; + $this->smarty->setCompileId(1); } - $result = $this->smarty->fetch('007_child_smartyparent.tpl'); - $this->assertContains('parent block Default Title is here', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); + $result = $this->smarty->fetch('007_child.tpl'); + $this->assertContains('(child|b)content (parent|b)content parent b(parent|/b) b(child|/b)', $result, + $testName . ' - content'); + $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $testName . ' - fetch() failure'); + } + + /** + * test grandchild/child/parent template chain with {$this->smarty.block.parent) + * + * @runInSeparateProcess + * @preserveGlobalState disabled + * @dataProvider data + */ + public function testCompileBlockChildSmartyParent_007_2($caching, $merge, $testNumber, $compileTestNumber, + $renderTestNumber, $testName) + { + $this->smarty->registerFilter('pre', array($this, 'compiledPrefilter')); + $this->smarty->assign('test', $testNumber); + $this->smarty->assign('parent', 'parent', true); + $this->smarty->assign('child', 'child', true); + $this->smarty->assign('grand', 'grand', true); + $this->smarty->setCaching($caching); + $this->smarty->setMergeCompiledIncludes($merge); + if ($merge) { + $this->smarty->setCompileId(1); + } + $result = $this->smarty->fetch('007_grand.tpl'); + $this->assertContains('(grand|b)content (child|b)content (parent|b)content parent b(parent|/b) b(child|/b) b(grand|/b)', + $result, $testName . ' - content'); + $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $testName . ' - fetch() failure'); } /** * test child/parent template chain loading plugin + * * @runInSeparateProcess * @preserveGlobalState disabled - * @dataProvider data + * @dataProvider data */ - public function testCompileBlockChildPlugin_008($caching, $merge, $testNumber, $compileTestNumber, $renderTestNumber, $testName) + public function testCompileBlockChildPlugin_008($caching, $merge, $testNumber, $compileTestNumber, + $renderTestNumber, $testName) { $this->smarty->registerFilter('pre', array($this, 'compiledPrefilter')); $this->smarty->assign('test', $testNumber); - $this->smarty->caching = $caching; - $this->smarty->merge_compiled_includes = $merge; + $this->smarty->assign('parent', 'parent', true); + $this->smarty->assign('child', 'child', true); + $this->smarty->assign('grand', 'grand', true); + $this->smarty->setCaching($caching); + $this->smarty->setMergeCompiledIncludes($merge); if ($merge) { - $this->smarty->compile_id = 1; + $this->smarty->setCompileId(1); } - $result = $this->smarty->fetch('008_child_plugin.tpl'); - $this->assertContains('escaped <text> 1', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); + $result = $this->smarty->fetch('008_child.tpl'); + $this->assertContains('(child|b)content escaped <text> child 1 b(child|/b', $result, + $testName . ' - content'); + $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $testName . ' - fetch() failure'); } - /** * test parent template with nested blocks + * * @runInSeparateProcess * @preserveGlobalState disabled - * @dataProvider data + * @dataProvider data */ - public function testCompileBlockParentNested_009($caching, $merge, $testNumber, $compileTestNumber, $renderTestNumber, $testName) + public function testCompileBlockParentNested_009($caching, $merge, $testNumber, $compileTestNumber, + $renderTestNumber, $testName) { $this->smarty->registerFilter('pre', array($this, 'compiledPrefilter')); $this->smarty->assign('test', $testNumber); - $this->smarty->caching = $caching; - $this->smarty->merge_compiled_includes = $merge; + $this->smarty->assign('parent', 'parent', true); + $this->smarty->setCaching($caching); + $this->smarty->setMergeCompiledIncludes($merge); if ($merge) { - $this->smarty->compile_id = 1; + $this->smarty->setCompileId(1); } - $result = $this->smarty->fetch('009_parent_nested.tpl'); - $this->assertContains('Title with -default- here', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); + $result = $this->smarty->fetch('009_parent.tpl'); + $this->assertContains('(parent|b)content (parent|c)content parent c(parent|/c) b(parent|/b)', $result, + $testName . ' - content'); + $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $testName . ' - fetch() failure'); } /** * test child/parent template chain with nested block + * * @runInSeparateProcess * @preserveGlobalState disabled - * @dataProvider data + * @dataProvider data */ - public function testCompileBlockChildNested_010($caching, $merge, $testNumber, $compileTestNumber, $renderTestNumber, $testName) + public function testCompileBlockChildNested_010($caching, $merge, $testNumber, $compileTestNumber, + $renderTestNumber, $testName) { $this->smarty->registerFilter('pre', array($this, 'compiledPrefilter')); $this->smarty->assign('test', $testNumber); - $this->smarty->caching = $caching; - $this->smarty->merge_compiled_includes = $merge; + $this->smarty->assign('parent', 'parent', true); + $this->smarty->assign('child', 'child', true); + $this->smarty->setCaching($caching); + $this->smarty->setMergeCompiledIncludes($merge); if ($merge) { - $this->smarty->compile_id = 1; + $this->smarty->setCompileId(1); } - $result = $this->smarty->fetch('010_child_nested.tpl'); - $this->assertContains('Title with -content from child- here', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); + $result = $this->smarty->fetch('010_child.tpl'); + $this->assertContains('(parent|b)content (parent|c)content child c(parent|/c) b(parent|/b)', $result, + $testName . ' - content'); + $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $testName . ' - fetch() failure'); } /** * test child/parent template chain with nested block and include + * * @runInSeparateProcess * @preserveGlobalState disabled - * @dataProvider data + * @dataProvider data */ - public function testCompileBlockChildNestedInclude_011($caching, $merge, $testNumber, $compileTestNumber, $renderTestNumber, $testName) + public function testCompileBlockChildNestedInclude_011($caching, $merge, $testNumber, $compileTestNumber, + $renderTestNumber, $testName) { $this->smarty->registerFilter('pre', array($this, 'compiledPrefilter')); $this->smarty->assign('test', $testNumber); - $this->smarty->caching = $caching; - $this->smarty->merge_compiled_includes = $merge; + $this->smarty->assign('parent', 'parent', true); + $this->smarty->assign('child', 'child', true); + $this->smarty->assign('grand', 'grand', true); + $this->smarty->setCaching($caching); + $this->smarty->setMergeCompiledIncludes($merge); if ($merge) { - $this->smarty->compile_id = 1; + $this->smarty->setCompileId(1); } - $result = $this->smarty->fetch('011_grandchild_nested_include.tpl'); - $this->assertContains('hello world', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); + $result = $this->smarty->fetch('011_grand.tpl'); + $this->assertContains('(child|b)content(child|c)content(child|n)content(include)content child i(/include)n(child|/n)c(child|/c)(grand|c)content grand c(grand|\c)b(child|/b)', + $result, $testName . ' - content'); + $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $testName . ' - fetch() failure'); } /** - * test grandchild/child/parent template chain + * test template chain with nested block level test + * * @runInSeparateProcess * @preserveGlobalState disabled - * @dataProvider data + * @dataProvider data */ - public function testCompileBlockGrandChild_012($caching, $merge, $testNumber, $compileTestNumber, $renderTestNumber, $testName) + public function testCompileBlockChildNestedInclude_012($caching, $merge, $testNumber, $compileTestNumber, + $renderTestNumber, $testName) { $this->smarty->registerFilter('pre', array($this, 'compiledPrefilter')); $this->smarty->assign('test', $testNumber); - $this->smarty->caching = $caching; - $this->smarty->merge_compiled_includes = $merge; + $this->smarty->assign('parent', 'parent', true); + $this->smarty->assign('child', 'child', true); + $this->smarty->assign('grand', 'grand', true); + $this->smarty->setCaching($caching); + $this->smarty->setMergeCompiledIncludes($merge); if ($merge) { - $this->smarty->compile_id = 1; + $this->smarty->setCompileId(1); } - $result = $this->smarty->fetch('012_grandchild.tpl'); - $this->assertContains('Grandchild Page Title', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); - } - - /** - * test grandchild/child/parent template chain prepend - * @runInSeparateProcess - * @preserveGlobalState disabled - * @dataProvider data - */ - public function testCompileBlockGrandChildPrepend_013($caching, $merge, $testNumber, $compileTestNumber, $renderTestNumber, $testName) - { - $this->smarty->registerFilter('pre', array($this, 'compiledPrefilter')); - $this->smarty->assign('test', $testNumber); - $this->smarty->caching = $caching; - $this->smarty->merge_compiled_includes = $merge; - if ($merge) { - $this->smarty->compile_id = 1; - } - $result = $this->smarty->fetch('013_grandchild_prepend.tpl'); - $this->assertContains('grandchild prepend - child', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); - } - /** - * test grandchild/child/parent template chain prepend - * @runInSeparateProcess - * @preserveGlobalState disabled - * @dataProvider data - */ - public function testCompileBlockGrandChildPrepend_013_2($caching, $merge, $testNumber, $compileTestNumber, $renderTestNumber, $testName) - { - $this->smarty->registerFilter('pre', array($this, 'compiledPrefilter')); - $this->smarty->assign('test', $testNumber); - $this->smarty->caching = $caching; - $this->smarty->merge_compiled_includes = $merge; - if ($merge) { - $this->smarty->compile_id = 1; - } - $result = $this->smarty->fetch('013_2_grandchild_prepend.tpl'); - $this->assertContains('grandchild prepend - child prepend - parent', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); - } - - /** - * test grandchild/child/parent template chain with {$this->smarty.block.child} - * @runInSeparateProcess - * @preserveGlobalState disabled - * @dataProvider data - */ - public function testCompileBlockGrandChildSmartyChild_014($caching, $merge, $testNumber, $compileTestNumber, $renderTestNumber, $testName) - { - $this->smarty->registerFilter('pre', array($this, 'compiledPrefilter')); - $this->smarty->assign('test', $testNumber); - $this->smarty->caching = $caching; - $this->smarty->merge_compiled_includes = $merge; - if ($merge) { - $this->smarty->compile_id = 1; - } - $result = $this->smarty->fetch('014_grandchild_smartychild.tpl'); - $this->assertContains('child title with - grandchild content - here', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); - } - - /** - * test grandchild/child/parent template chain append - * @runInSeparateProcess - * @preserveGlobalState disabled - * @dataProvider data - */ - public function testCompileBlockGrandChildAppend_015($caching, $merge, $testNumber, $compileTestNumber, $renderTestNumber, $testName) - { - $this->smarty->registerFilter('pre', array($this, 'compiledPrefilter')); - $this->smarty->assign('test', $testNumber); - $this->smarty->caching = $caching; - $this->smarty->merge_compiled_includes = $merge; - if ($merge) { - $this->smarty->compile_id = 1; - } - $result = $this->smarty->fetch('015_grandchild_append.tpl'); - $this->assertContains('Page Title - grandchild append', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); - } - - /** - * test grandchild/child/parent template chain with nested block - * @runInSeparateProcess - * @preserveGlobalState disabled - * @dataProvider data - */ - public function testCompileBlockGrandChildNested_016($caching, $merge, $testNumber, $compileTestNumber, $renderTestNumber, $testName) - { - $this->smarty->registerFilter('pre', array($this, 'compiledPrefilter')); - $this->smarty->assign('test', $testNumber); - $this->smarty->caching = $caching; - $this->smarty->merge_compiled_includes = $merge; - if ($merge) { - $this->smarty->compile_id = 1; - } - $result = $this->smarty->fetch('016_grandchild_nested.tpl'); - $this->assertContains('child title with -grandchild content- here', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); - } - - /** - * test grandchild/child/parent template chain with nested {$this->smarty.block.child} - * @runInSeparateProcess - * @preserveGlobalState disabled - * @dataProvider data - */ - public function testCompileBlockGrandChildNested_017($caching, $merge, $testNumber, $compileTestNumber, $renderTestNumber, $testName) - { - $this->smarty->registerFilter('pre', array($this, 'compiledPrefilter')); - $this->smarty->assign('test', $testNumber); - $this->smarty->caching = $caching; - $this->smarty->merge_compiled_includes = $merge; - if ($merge) { - $this->smarty->compile_id = 1; - } - $result = $this->smarty->fetch('017_grandchild_nested.tpl'); - $this->assertContains('child pre -grandchild content- child post', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); + $result = $this->smarty->fetch('012_grandgrand.tpl'); + $this->assertContains('(grand|b)content (grandgrand|c)content c(grandgrand|\c)(grand|c)content c(grand|\c) b(grand|/b)', + $result, $testName . ' - content'); + $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $testName . ' - fetch() failure'); } /** * test nested child block with hide + * * @runInSeparateProcess * @preserveGlobalState disabled - * @dataProvider data + * @dataProvider data */ - public function testCompileBlockChildNestedHide_018($caching, $merge, $testNumber, $compileTestNumber, $renderTestNumber, $testName) + public function testCompileBlockChildNestedHide_018($caching, $merge, $testNumber, $compileTestNumber, + $renderTestNumber, $testName) { $this->smarty->registerFilter('pre', array($this, 'compiledPrefilter')); $this->smarty->assign('test', $testNumber); - $this->smarty->caching = $caching; - $this->smarty->merge_compiled_includes = $merge; + $this->smarty->setCaching($caching); + $this->smarty->setMergeCompiledIncludes($merge); if ($merge) { - $this->smarty->compile_id = 1; + $this->smarty->setCompileId(1); } - $result = $this->smarty->fetch('018_child_nested_hide.tpl'); - $this->assertContains('nested block', $result); - $this->assertNotContains('should be hidden', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); + $result = $this->smarty->fetch('018_child.tpl'); + $this->assertContains('(child|b)content(child|c)content child c(child|/c)b(child|/b)', $result, + $testName . ' - content'); + $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $testName . ' - fetch() failure'); } /** - * test nested child block with hide and auto_literal = false + * test nested grand/child block with hide + * * @runInSeparateProcess * @preserveGlobalState disabled - * @dataProvider data + * @dataProvider data */ - public function testCompileBlockChildNestedHideAutoLiteralFalse_019($caching, $merge, $testNumber, $compileTestNumber, $renderTestNumber, $testName) + public function testCompileBlockChildNestedHide_018_2($caching, $merge, $testNumber, $compileTestNumber, + $renderTestNumber, $testName) { $this->smarty->registerFilter('pre', array($this, 'compiledPrefilter')); $this->smarty->assign('test', $testNumber); - $this->smarty->caching = $caching; - $this->smarty->merge_compiled_includes = $merge; + $this->smarty->setCaching($caching); + $this->smarty->setMergeCompiledIncludes($merge); if ($merge) { - $this->smarty->compile_id = 1; + $this->smarty->setCompileId(1); } - $this->smarty->setAutoLiteral(false); - $result = $this->smarty->fetch('019_child_nested_hide_autoliteral.tpl'); - $this->assertContains('nested block', $result, $testName . ' - content'); - $this->assertNotContains('should be hidden', $result, $testName . ' - content2'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); + $result = $this->smarty->fetch('018_grand.tpl'); + $this->assertContains('(child|b)content(child|c)content child c(child|/c)(child|d)content (grand|d)content grand d(grand|/d) d(child|/d)b(child|/b)', + $result, $testName . ' - content'); + $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $testName . ' - fetch() failure'); + } + + /** + * test nested grandgrand/grand/child block with hide + * + * @runInSeparateProcess + * @preserveGlobalState disabled + * @dataProvider data + */ + public function testCompileBlockChildNestedHide_018_3($caching, $merge, $testNumber, $compileTestNumber, + $renderTestNumber, $testName) + { + $this->smarty->registerFilter('pre', array($this, 'compiledPrefilter')); + $this->smarty->assign('test', $testNumber); + $this->smarty->setCaching($caching); + $this->smarty->setMergeCompiledIncludes($merge); + if ($merge) { + $this->smarty->setCompileId(1); + } + $result = $this->smarty->fetch('018_grandgrand.tpl'); + $this->assertContains('(child|b)content(grand|c)content (grandgrand|c)content grandgrand c(grandgrand|/c) c(grand|/c)(child|d)content (grandgrand|d)content grandgrand d(grandgrand|/d) d(child|/d)b(child|/b)', + $result, $testName . ' - content'); + $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $testName . ' - fetch() failure'); } /** * test child/parent template chain starting in subtempates + * * @runInSeparateProcess * @preserveGlobalState disabled - * @dataProvider data + * @dataProvider data */ - public function testCompileBlockStartSubTemplates_020($caching, $merge, $testNumber, $compileTestNumber, $renderTestNumber, $testName) + public function testCompileBlockStartSubTemplates_020($caching, $merge, $testNumber, $compileTestNumber, + $renderTestNumber, $testName) { $this->smarty->registerFilter('pre', array($this, 'compiledPrefilter')); $this->smarty->assign('test', $testNumber); - $this->smarty->caching = $caching; - $this->smarty->merge_compiled_includes = $merge; + $this->smarty->setCaching($caching); + $this->smarty->setMergeCompiledIncludes($merge); if ($merge) { - $this->smarty->compile_id = 1; + $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('020_include_root.tpl'); - $this->assertContains('page 1', $result, $testName . ' - content1'); - $this->assertContains('page 2', $result, $testName . ' - content2'); - $this->assertContains('page 3', $result, $testName . ' - content3'); - $this->assertContains('block 1', $result, $testName . ' - content4'); - $this->assertContains('block 2', $result, $testName . ' - content5'); - $this->assertContains('block 3', $result, $testName . ' - content6'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); - } - - /** - * test grandchild/child/parent template chain with nested {$this->smarty.block.child} and {include nocache} - * @runInSeparateProcess - * @preserveGlobalState disabled - * @dataProvider data - */ - public function testCompileBlockGrandChildNested_030($caching, $merge, $testNumber, $compileTestNumber, $renderTestNumber, $testName) - { - $this->smarty->registerFilter('pre', array($this, 'compiledPrefilter')); - $this->smarty->assign('test', $testNumber); - $this->smarty->caching = $caching; - $this->smarty->merge_compiled_includes = $merge; - if ($merge) { - $this->smarty->compile_id = 1; - } - $result = $this->smarty->fetch('030_grandchild_nested.tpl'); - $this->assertContains('child pre -grandchild content- child post', $result, $testName . ' - content'); - $this->assertContains('include:' . $testNumber, $result, $testName . ' - content 2'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); + $this->assertContains('(include1)(include1|p)content 1 p(include1|\p)(include1|b)content 1 b(include1|\b)(\include1)', + $result, $testName . ' - include 1'); + $this->assertContains('(include2)(include2|p)content 2 p(include2|\p)(include2|b)content 2 b(include2|\b)(\include2)', + $result, $testName . ' - include 1'); + $this->assertContains('(include3)(include3|p)content 3 p(include3|\p)(include3|b)content 3 b(include3|\b)(\include3)', + $result, $testName . ' - include 1'); + $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $testName . ' - fetch() failure'); } /** * test grandchild/child/parent dependency test1 + * * @runInSeparateProcess * @preserveGlobalState disabled */ public function testCompileBlockGrandChildMustCompile_021_1() { + $this->smarty->assign('parent', 'parent'); + $this->smarty->assign('child', 'child', true); + $this->smarty->assign('grand', 'grand', true); $this->smarty->setCompileDir('./templates_c/mustcompile'); $this->smarty->caching = true; $this->smarty->cache_lifetime = 1000; - $tpl = $this->smarty->createTemplate('021_grandchild.tpl'); + $tpl = $this->smarty->createTemplate('021_grand.tpl', $this->smarty); $this->assertFalse($tpl->isCached()); $result = $this->smarty->fetch($tpl); - $this->assertContains('Grandchild Page Title', $result); - $this->smarty->_cache['template_objects'] = null; - $tpl2 = $this->smarty->createTemplate('021_grandchild.tpl'); + $this->assertContains('(grand|b)content grand b(grand|/b)(child|b)content child b(child|/b)(parent|b)content parent b(parent|/b)', + $result); + $this->smarty->_clearTemplateCache(); + $this->smarty->assign('parent', 'parent2'); + $this->smarty->assign('child', 'child2', true); + $this->smarty->assign('grand', 'grand2', true); + $tpl2 = $this->smarty->createTemplate('021_grand.tpl', $this->smarty); $this->assertTrue($tpl2->isCached()); $result = $this->smarty->fetch($tpl2); - $this->assertContains('Grandchild Page Title', $result); + $this->assertContains('(grand|b)content grand2 b(grand|/b)(child|b)content child2 b(child|/b)(parent|b)content parent b(parent|/b)', + $result); + } + + /** + * test grandchild/child/parent dependency test1 + * + * @runInSeparateProcess + * @preserveGlobalState disabled + */ + public function testCompileBlockGrandChildMustCompile_021_12() + { + $this->smarty->setCompileDir('./templates_c/mustcompile'); + $this->smarty->caching = true; + $this->smarty->cache_lifetime = 1000; + $this->smarty->assign('parent', 'parent3'); + $this->smarty->assign('child', 'child3', true); + $this->smarty->assign('grand', 'grand3', true); + $tpl2 = $this->smarty->createTemplate('021_grand.tpl', $this->smarty); + $this->assertTrue($tpl2->isCached()); + $result = $this->smarty->fetch($tpl2); + $this->assertContains('(grand|b)content grand3 b(grand|/b)(child|b)content child3 b(child|/b)(parent|b)content parent b(parent|/b)', + $result); } /** * test grandchild/child/parent dependency test2 + * * @runInSeparateProcess * @preserveGlobalState disabled * */ public function testCompileBlockGrandChildMustCompile_021_2() { + $this->smarty->assign('parent', 'parent4'); + $this->smarty->assign('child', 'child4', true); + $this->smarty->assign('grand', 'grand4', true); $this->smarty->setCompileDir('./templates_c/mustcompile'); sleep(2); - touch($this->smarty->getTemplateDir(0) . '021_grandchild.tpl'); + touch($this->smarty->getTemplateDir(0) . '021_grand.tpl'); clearstatcache(); $this->smarty->caching = true; $this->smarty->cache_lifetime = 1000; - $tpl = $this->smarty->createTemplate('021_grandchild.tpl'); + $tpl = $this->smarty->createTemplate('021_grand.tpl', $this->smarty); $this->assertFalse($tpl->isCached()); $result = $this->smarty->fetch($tpl); - $this->assertContains('Grandchild Page Title', $result); - $this->smarty->_cache['template_objects'] = null; - $tpl2 = $this->smarty->createTemplate('021_grandchild.tpl'); + $this->assertContains('(grand|b)content grand4 b(grand|/b)(child|b)content child4 b(child|/b)(parent|b)content parent4 b(parent|/b)', + $result); + $this->smarty->_clearTemplateCache(); + $this->smarty->assign('parent', 'parent5'); + $this->smarty->assign('child', 'child5', true); + $this->smarty->assign('grand', 'grand5', true); + $this->smarty->setCompileDir('./templates_c/mustcompile'); + $tpl2 = $this->smarty->createTemplate('021_grand.tpl', $this->smarty); $this->assertTrue($tpl2->isCached()); $result = $this->smarty->fetch($tpl2); - $this->assertContains('Grandchild Page Title', $result); + $this->assertContains('(grand|b)content grand5 b(grand|/b)(child|b)content child5 b(child|/b)(parent|b)content parent4 b(parent|/b)', + $result); } /** * test grandchild/child/parent dependency test3 + * * @runInSeparateProcess * @preserveGlobalState disabled * */ public function testCompileBlockGrandChildMustCompile_021_3() { + $this->smarty->assign('parent', 'parent6'); + $this->smarty->assign('child', 'child6', true); + $this->smarty->assign('grand', 'grand6', true); $this->smarty->setCompileDir('./templates_c/mustcompile'); sleep(2); touch($this->smarty->getTemplateDir(0) . '021_child.tpl'); clearstatcache(); $this->smarty->caching = true; $this->smarty->cache_lifetime = 1000; - $tpl = $this->smarty->createTemplate('021_grandchild.tpl'); + $tpl = $this->smarty->createTemplate('021_grand.tpl', $this->smarty); $this->assertFalse($tpl->isCached()); $result = $this->smarty->fetch($tpl); - $this->assertContains('Grandchild Page Title', $result); + $this->assertContains('(grand|b)content grand6 b(grand|/b)(child|b)content child6 b(child|/b)(parent|b)content parent6 b(parent|/b)', + $result); } + /** * test grandchild/child/parent dependency test3 + * * @runInSeparateProcess * @preserveGlobalState disabled * */ public function testCompileBlockGrandChildMustCompile_021_32() { + $this->smarty->assign('parent', 'parent7'); + $this->smarty->assign('child', 'child7', true); + $this->smarty->assign('grand', 'grand7', true); $this->smarty->setCompileDir('./templates_c/mustcompile'); $this->smarty->caching = true; $this->smarty->cache_lifetime = 1000; - $tpl2 = $this->smarty->createTemplate('021_grandchild.tpl'); + $tpl2 = $this->smarty->createTemplate('021_grand.tpl', $this->smarty); $this->assertTrue($tpl2->isCached()); $result = $this->smarty->fetch($tpl2); - $this->assertContains('Grandchild Page Title', $result); + $this->assertContains('(grand|b)content grand7 b(grand|/b)(child|b)content child7 b(child|/b)(parent|b)content parent6 b(parent|/b)', + $result); } /** * test grandchild/child/parent dependency test4 + * * @runInSeparateProcess * @preserveGlobalState disabled */ public function testCompileBlockGrandChildMustCompile_021_4() { + $this->smarty->assign('parent', 'parent8'); + $this->smarty->assign('child', 'child8', true); + $this->smarty->assign('grand', 'grand8', true); $this->smarty->setCompileDir('./templates_c/mustcompile'); sleep(2); touch($this->smarty->getTemplateDir(0) . '021_parent.tpl'); clearstatcache(); $this->smarty->caching = true; $this->smarty->cache_lifetime = 1000; - $tpl = $this->smarty->createTemplate('021_grandchild.tpl'); + $tpl = $this->smarty->createTemplate('021_grand.tpl', $this->smarty); $this->assertFalse($tpl->isCached()); $result = $this->smarty->fetch($tpl); - $this->assertContains('Grandchild Page Title', $result); + $this->assertContains('(grand|b)content grand8 b(grand|/b)(child|b)content child8 b(child|/b)(parent|b)content parent8 b(parent|/b)', + $result); } /** * test grandchild/child/parent dependency test4 + * * @runInSeparateProcess * @preserveGlobalState disabled */ public function testCompileBlockGrandChildMustCompile_021_42() { + $this->smarty->assign('parent', 'parent9'); + $this->smarty->assign('child', 'child9', true); + $this->smarty->assign('grand', 'grand9', true); $this->smarty->setCompileDir('./templates_c/mustcompile'); $this->smarty->caching = true; $this->smarty->cache_lifetime = 1000; - $tpl2 = $this->smarty->createTemplate('021_grandchild.tpl'); + $tpl2 = $this->smarty->createTemplate('021_grand.tpl', $this->smarty); $this->assertTrue($tpl2->isCached()); $result = $this->smarty->fetch($tpl2); - $this->assertContains('Grandchild Page Title', $result); + $this->assertContains('(grand|b)content grand9 b(grand|/b)(child|b)content child9 b(child|/b)(parent|b)content parent8 b(parent|/b)', + $result); } /** @@ -627,8 +757,8 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty */ public function testSmartyBlockChildOutsideBlock_025() { - $this->smarty->fetch('025_parent.tpl'); - } + $this->smarty->fetch('025_parent.tpl'); + } /** * @expectedException SmartyCompilerException @@ -650,54 +780,80 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $result = $this->smarty->fetch('027_parent.tpl'); } - /** * test child/parent template chain * * @runInSeparateProcess * @preserveGlobalState disabled - * @dataProvider data + * @dataProvider data */ - public function testSmartyBlockVariablePartentInclude_28($caching, $merge, $testNumber, $compileTestNumber, $renderTestNumber, $testName) + public function testSmartyBlockVariablePartentInclude_28($caching, $merge, $testNumber, $compileTestNumber, + $renderTestNumber, $testName) { $this->smarty->registerFilter('pre', array($this, 'compiledPrefilter')); $this->smarty->assign('test', $testNumber); - $this->smarty->caching = $caching; - $this->smarty->merge_compiled_includes = $merge; - $this->smarty->compile_id = 10; + $this->smarty->setCaching($caching); + $this->smarty->setMergeCompiledIncludes($merge); + $this->smarty->setCompileId(10); if ($merge) { - $this->smarty->compile_id = 11; + $this->smarty->setCompileId(11); } $this->smarty->assign('foo', '028_parent_include1.tpl'); $result = $this->smarty->fetch('028_child.tpl'); $this->assertContains('b1-include-1--b1', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); + $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $testName . ' - fetch() failure'); } /** * test child/parent template chain + * * @dataProvider data */ - public function testSmartyBlockVariablePartentInclude_282($caching, $merge, $testNumber, $compileTestNumber, $renderTestNumber, $testName) + public function testSmartyBlockVariablePartentInclude_282($caching, $merge, $testNumber, $compileTestNumber, + $renderTestNumber, $testName) { $this->smarty->registerFilter('pre', array($this, 'compiledPrefilter')); $this->smarty->assign('test', $testNumber); - $this->smarty->caching = $caching; - $this->smarty->merge_compiled_includes = $merge; + $this->smarty->setCaching($caching); + $this->smarty->setMergeCompiledIncludes($merge); if ($merge) { - $this->smarty->compile_id = 1; + $this->smarty->setCompileId(1); } $this->smarty->assign('foo', '028_parent_include2.tpl'); $result = $this->smarty->fetch('028_child.tpl'); $this->assertContains('b1-child-i2-include-2--b1', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); + $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $testName . ' - fetch() failure'); } + /** + * test grandchild/child/parent template chain with nested {$this->smarty.block.child} and {include nocache} + * + * @runInSeparateProcess + * @preserveGlobalState disabled + * @dataProvider data + */ + public function testCompileBlockGrandChildNested_030($caching, $merge, $testNumber, $compileTestNumber, + $renderTestNumber, $testName) + { + $this->smarty->registerFilter('pre', array($this, 'compiledPrefilter')); + $this->smarty->assign('test', $testNumber); + $this->smarty->setCaching($caching); + $this->smarty->setMergeCompiledIncludes($merge); + if ($merge) { + $this->smarty->setCompileId(1); + } + $result = $this->smarty->fetch('030_grandchild_nested.tpl'); + $this->assertContains('child pre -grandchild content- child post', $result, $testName . ' - content'); + $this->assertContains('include:' . $testNumber, $result, $testName . ' - content 2'); + $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $testName . ' - fetch() failure'); + } - - public function data(){ - return array( - /* + public function data() + { + return array(/* * caching * merging * test nr @@ -705,29 +861,29 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty * result render nr * text */ - array(false, false, 1, 1, 1, 'no caching, no merge - new'), - array(false, false, 2, 1, 2, 'no caching, no merge - exits'), - array(true, false, 3, 3, 3, 'caching, no merge - new'), - array(true, false, 4, 3, 3, 'caching, no merge - exits'), - array(false, true, 5, 5, 5, 'no caching, merge - new'), - array(false, true, 6, 5, 6, 'no caching, merge - exits'), - array(true, true, 7, 7, 7, 'caching, merge - new'), - array(true, true, 8, 7, 7, 'caching, merge - exits'), - ); + array(false, false, 1, 1, 1, 'no caching, no merge - new'), + array(false, false, 2, 1, 2, 'no caching, no merge - exits'), + array(true, false, 3, 3, 3, 'caching, no merge - new'), + array(true, false, 4, 3, 3, 'caching, no merge - exits'), + array(false, true, 5, 5, 5, 'no caching, merge - new'), + array(false, true, 6, 5, 6, 'no caching, merge - exits'), + array(true, true, 7, 7, 7, 'caching, merge - new'), + array(true, true, 8, 7, 7, 'caching, merge - exits'),); } /* * Test post filter on {block} */ - public function testPostFilter_031(){ + public function testPostFilter_031() + { function smarty_postfilter_test031($compiled, Smarty_Internal_Template $template) { return str_replace("'foo'", "'bar'", $compiled); } - $this->smarty->loadFilter('post','test031'); - $this->smarty->assign('foo','foo'); - $this->smarty->assign('bar','bar'); - $this->assertContains('bar', $this->smarty->fetch('031_post_filter.tpl')); + $this->smarty->loadFilter('post', 'test031'); + $this->smarty->assign('foo', 'foo'); + $this->smarty->assign('bar', 'bar'); + $this->assertContains('bar', $this->smarty->fetch('031_post_filter.tpl')); } } diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/001_parent.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/001_parent.tpl index e007864b..9905f864 100644 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/001_parent.tpl +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/001_parent.tpl @@ -1 +1 @@ -{block name='title'}Default Title{/block} +{block name='b'}(parent|b)content {$parent} b(parent|/b){/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/002_child.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/002_child.tpl index bac2cf93..b17c2973 100644 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/002_child.tpl +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/002_child.tpl @@ -1,2 +1,2 @@ {extends file='002_parent.tpl'} -{block name='title'}Page Title{/block} +{block name='b'}(child|b)content {$child} b(child|/b){/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/002_parent.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/002_parent.tpl index afcf7d7c..07bb4259 100644 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/002_parent.tpl +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/002_parent.tpl @@ -1,2 +1,2 @@ test:{$test nocache} compiled:# rendered:{$test} -{block name='title'}Default Title{/block} +{block name='b'}(parent|b)content {$parent} b(parent|/b){/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/003_child.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/003_child.tpl new file mode 100644 index 00000000..db178929 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/003_child.tpl @@ -0,0 +1,2 @@ +{extends file='003_parent.tpl'} +{block name='b' prepend}(child|b)content {$child} b(child|/b){/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/003_child_prepend.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/003_child_prepend.tpl deleted file mode 100644 index 81acb6d7..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/003_child_prepend.tpl +++ /dev/null @@ -1,2 +0,0 @@ -{extends file='003_parent.tpl'} -{block name='title' prepend}prepend - {/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/003_grand.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/003_grand.tpl new file mode 100644 index 00000000..2a4cfa83 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/003_grand.tpl @@ -0,0 +1,2 @@ +{extends file='003_child.tpl'} +{block name='b' prepend}(grand|b)content {$grand} b(grand|/b){/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/003_parent.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/003_parent.tpl index afcf7d7c..36ae8965 100644 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/003_parent.tpl +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/003_parent.tpl @@ -1,2 +1,3 @@ test:{$test nocache} compiled:# rendered:{$test} -{block name='title'}Default Title{/block} +{block name='b'}(parent|b)content {$parent} b(parent|/b){/block} + diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/004_child.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/004_child.tpl new file mode 100644 index 00000000..f887fb2a --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/004_child.tpl @@ -0,0 +1,2 @@ +{extends file='004_parent.tpl'} +{block name='b' append}(child|b)content {$child} b(child|/b){/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/004_child_append.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/004_child_append.tpl deleted file mode 100644 index d6dd84c0..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/004_child_append.tpl +++ /dev/null @@ -1,2 +0,0 @@ -{extends file='004_parent.tpl'} -{block name='title' append} - append{/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/004_grand.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/004_grand.tpl new file mode 100644 index 00000000..5a15ef4c --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/004_grand.tpl @@ -0,0 +1,2 @@ +{extends file='004_child.tpl'} +{block name='b' append}(grand|b)content {$grand} b(grand|/b){/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/004_grand2.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/004_grand2.tpl new file mode 100644 index 00000000..adfa4c27 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/004_grand2.tpl @@ -0,0 +1,2 @@ +{extends file='004_child.tpl'} +{block name='b' append prepend}(grand|b)content {$grand} b(grand|/b){/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/004_parent.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/004_parent.tpl index afcf7d7c..07bb4259 100644 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/004_parent.tpl +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/004_parent.tpl @@ -1,2 +1,2 @@ test:{$test nocache} compiled:# rendered:{$test} -{block name='title'}Default Title{/block} +{block name='b'}(parent|b)content {$parent} b(parent|/b){/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/005_child.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/005_child.tpl new file mode 100644 index 00000000..3d822c28 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/005_child.tpl @@ -0,0 +1,2 @@ +{extends '005_parent.tpl'} +{block 'b' append}(child|b)content {$child} b(child|/b){/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/005_child_append_shorttag.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/005_child_append_shorttag.tpl deleted file mode 100644 index 3aac9add..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/005_child_append_shorttag.tpl +++ /dev/null @@ -1,2 +0,0 @@ -{extends file='005_parent_shorttag.tpl'} -{block 'title' append} - append{/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/005_parent.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/005_parent.tpl new file mode 100644 index 00000000..093ed256 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/005_parent.tpl @@ -0,0 +1,2 @@ +test:{$test nocache} compiled:# rendered:{$test} +{block 'b'}(parent|b)content {$parent} b(parent|/b){/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/005_parent_shorttag.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/005_parent_shorttag.tpl deleted file mode 100644 index fbe3880a..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/005_parent_shorttag.tpl +++ /dev/null @@ -1,2 +0,0 @@ -test:{$test nocache} compiled:# rendered:{$test} -

{block 'title'}Default Title{/block}

diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/006_child.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/006_child.tpl new file mode 100644 index 00000000..43a47504 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/006_child.tpl @@ -0,0 +1,2 @@ +{extends file='006_parent.tpl'} +{block name='b'}(child|b)content {$child} b(child|/b){/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/006_child_smartychild.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/006_child_smartychild.tpl deleted file mode 100644 index ba550f03..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/006_child_smartychild.tpl +++ /dev/null @@ -1,3 +0,0 @@ -{extends file='006_parent_smartychild.tpl'} -{block name='title'}child text{/block} - diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/006_parent.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/006_parent.tpl new file mode 100644 index 00000000..9774ebb4 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/006_parent.tpl @@ -0,0 +1,2 @@ +test:{$test nocache} compiled:# rendered:{$test} +{block name='b'}(parent|b)content {$smarty.block.child} b(parent|/b){/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/006_parent_smartychild.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/006_parent_smartychild.tpl deleted file mode 100644 index 4673ccb7..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/006_parent_smartychild.tpl +++ /dev/null @@ -1,2 +0,0 @@ -test:{$test nocache} compiled:# rendered:{$test} -{block name='title'}here is >{$smarty.block.child}< included{/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/007_child.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/007_child.tpl new file mode 100644 index 00000000..4ac41f82 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/007_child.tpl @@ -0,0 +1,2 @@ +{extends file='007_parent.tpl'} +{block name='b'}(child|b)content {$smarty.block.parent} b(child|/b){/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/007_child_smartyparent.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/007_child_smartyparent.tpl deleted file mode 100644 index 41b6e27f..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/007_child_smartyparent.tpl +++ /dev/null @@ -1,2 +0,0 @@ -{extends file='007_parent.tpl'} -{block name='title'}parent block {$smarty.block.parent} is here{/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/007_grand.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/007_grand.tpl new file mode 100644 index 00000000..83dba9fe --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/007_grand.tpl @@ -0,0 +1,2 @@ +{extends file='007_child.tpl'} +{block name='b'}(grand|b)content {$smarty.block.parent} b(grand|/b){/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/007_parent.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/007_parent.tpl index afcf7d7c..602e45fe 100644 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/007_parent.tpl +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/007_parent.tpl @@ -1,2 +1,2 @@ test:{$test nocache} compiled:# rendered:{$test} -{block name='title'}Default Title{/block} +{block name='b'}(parent|b)content {$parent} b(parent|/b){/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/008_child.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/008_child.tpl new file mode 100644 index 00000000..8f7312bd --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/008_child.tpl @@ -0,0 +1,2 @@ +{extends file='008_parent.tpl'} +{block name='b'}(child|b)content {'escaped '|escape} {$child} {counter start=1} b(child|/b){/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/008_child_plugin.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/008_child_plugin.tpl deleted file mode 100644 index 54f67d6c..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/008_child_plugin.tpl +++ /dev/null @@ -1,2 +0,0 @@ -{extends file='008_parent.tpl'} -{block name='title'}{'escaped '|escape} {counter start=1}{/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/008_parent.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/008_parent.tpl index afcf7d7c..07bb4259 100644 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/008_parent.tpl +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/008_parent.tpl @@ -1,2 +1,2 @@ test:{$test nocache} compiled:# rendered:{$test} -{block name='title'}Default Title{/block} +{block name='b'}(parent|b)content {$parent} b(parent|/b){/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/009_parent.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/009_parent.tpl new file mode 100644 index 00000000..0323dde5 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/009_parent.tpl @@ -0,0 +1,2 @@ +test:{$test nocache} compiled:# rendered:{$test} +{block name='b'}(parent|b)content {block name='c'}(parent|c)content {$parent} c(parent|/c){/block} b(parent|/b){/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/009_parent_nested.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/009_parent_nested.tpl deleted file mode 100644 index e7d9c71b..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/009_parent_nested.tpl +++ /dev/null @@ -1,2 +0,0 @@ -test:{$test nocache} compiled:# rendered:{$test} -{block name='title'}Title with {block name='title_content'}-default-{/block} here{/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/010_child.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/010_child.tpl new file mode 100644 index 00000000..9db0214e --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/010_child.tpl @@ -0,0 +1,2 @@ +{extends file='010_parent.tpl'} +{block name='c'}(parent|c)content {$child} c(parent|/c){/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/010_child_nested.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/010_child_nested.tpl deleted file mode 100644 index 5055bd51..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/010_child_nested.tpl +++ /dev/null @@ -1,2 +0,0 @@ -{extends file='010_parent_nested.tpl'} -{block name='title_content'}-content from child-{/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/010_parent.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/010_parent.tpl new file mode 100644 index 00000000..0323dde5 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/010_parent.tpl @@ -0,0 +1,2 @@ +test:{$test nocache} compiled:# rendered:{$test} +{block name='b'}(parent|b)content {block name='c'}(parent|c)content {$parent} c(parent|/c){/block} b(parent|/b){/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/010_parent_nested.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/010_parent_nested.tpl deleted file mode 100644 index e7d9c71b..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/010_parent_nested.tpl +++ /dev/null @@ -1,2 +0,0 @@ -test:{$test nocache} compiled:# rendered:{$test} -{block name='title'}Title with {block name='title_content'}-default-{/block} here{/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/011_child.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/011_child.tpl new file mode 100644 index 00000000..98f3eb3d --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/011_child.tpl @@ -0,0 +1,12 @@ +{extends file='011_parent.tpl'} +{strip} +{block name='b'}(child|b)content + {block name='c'}(child|c)content + {block name='n'}(child|n)content + {include file='011_include.tpl'} + n(child|/n) + {/block} + c(child|/c) + {/block} + b(child|/b) +{/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/011_child_nested_include.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/011_child_nested_include.tpl deleted file mode 100644 index 148887bb..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/011_child_nested_include.tpl +++ /dev/null @@ -1,4 +0,0 @@ -{extends file='011_parent_nested_include.tpl'} -{block name='body'} - {block name='title_content'}{block name='nested'}{include file='helloworld.tpl'}{/block}{/block} -{/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/011_grand.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/011_grand.tpl new file mode 100644 index 00000000..a93a4143 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/011_grand.tpl @@ -0,0 +1,5 @@ +{extends file='011_child.tpl'} +{strip} +{block name='c' append} + (grand|c)content {$grand} c(grand|\c) +{/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/011_grandchild_nested_include.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/011_grandchild_nested_include.tpl deleted file mode 100644 index 1935b241..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/011_grandchild_nested_include.tpl +++ /dev/null @@ -1,2 +0,0 @@ -{extends file='011_child_nested_include.tpl'} -{block name='title_content' append} some content {/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/011_include.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/011_include.tpl new file mode 100644 index 00000000..704ca492 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/011_include.tpl @@ -0,0 +1 @@ +(include)content {$child} i(/include) \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/011_parent.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/011_parent.tpl new file mode 100644 index 00000000..07bb4259 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/011_parent.tpl @@ -0,0 +1,2 @@ +test:{$test nocache} compiled:# rendered:{$test} +{block name='b'}(parent|b)content {$parent} b(parent|/b){/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/011_parent_nested_include.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/011_parent_nested_include.tpl deleted file mode 100644 index adf5e27f..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/011_parent_nested_include.tpl +++ /dev/null @@ -1,2 +0,0 @@ -test:{$test nocache} compiled:# rendered:{$test} -{block name='body'}-default-{/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/012_child.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/012_child.tpl index 939195b3..6f95ae50 100644 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/012_child.tpl +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/012_child.tpl @@ -1,2 +1,2 @@ {extends file='012_parent.tpl'} -{block name='title'}Page Title{/block} +{block name='c' prepend}(child|c)content {$child} c(child|/c){/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/012_grand.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/012_grand.tpl new file mode 100644 index 00000000..00b98f3a --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/012_grand.tpl @@ -0,0 +1,2 @@ +{extends file='012_child.tpl'} +{block name='b'}(grand|b)content {block name='c'}(grand|c)content c(grand|\c){/block} b(grand|/b){/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/012_grandchild.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/012_grandchild.tpl deleted file mode 100644 index c485967a..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/012_grandchild.tpl +++ /dev/null @@ -1,2 +0,0 @@ -{extends file='012_child.tpl'} -{block name='title'}Grandchild Page Title{/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/012_grandgrand.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/012_grandgrand.tpl new file mode 100644 index 00000000..1312dfc9 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/012_grandgrand.tpl @@ -0,0 +1,2 @@ +{extends file='012_grand.tpl'} +{block name='c' prepend}(grandgrand|c)content c(grandgrand|\c){/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/012_parent.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/012_parent.tpl index afcf7d7c..602e45fe 100644 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/012_parent.tpl +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/012_parent.tpl @@ -1,2 +1,2 @@ test:{$test nocache} compiled:# rendered:{$test} -{block name='title'}Default Title{/block} +{block name='b'}(parent|b)content {$parent} b(parent|/b){/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/013_2_child_prepend.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/013_2_child_prepend.tpl deleted file mode 100644 index 636035aa..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/013_2_child_prepend.tpl +++ /dev/null @@ -1,2 +0,0 @@ -{extends file='013_parent.tpl'} -{block name='title' prepend}child prepend - {/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/013_2_grandchild_prepend.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/013_2_grandchild_prepend.tpl deleted file mode 100644 index a960f0da..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/013_2_grandchild_prepend.tpl +++ /dev/null @@ -1,2 +0,0 @@ -{extends file='013_2_child_prepend.tpl'} -{block name='title' prepend}grandchild prepend - {/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/013_child.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/013_child.tpl deleted file mode 100644 index 6abee6d3..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/013_child.tpl +++ /dev/null @@ -1,2 +0,0 @@ -{extends file='013_parent.tpl'} -{block name='title'}child{/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/013_grandchild_prepend.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/013_grandchild_prepend.tpl deleted file mode 100644 index b78367fd..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/013_grandchild_prepend.tpl +++ /dev/null @@ -1,2 +0,0 @@ -{extends file='013_child.tpl'} -{block name='title' prepend}grandchild prepend - {/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/013_parent.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/013_parent.tpl deleted file mode 100644 index bf4de3ab..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/013_parent.tpl +++ /dev/null @@ -1,2 +0,0 @@ -test:{$test nocache} compiled:# rendered:{$test} -{block name='title'}parent{/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/014_child_smartychild.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/014_child_smartychild.tpl deleted file mode 100644 index 521b0f67..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/014_child_smartychild.tpl +++ /dev/null @@ -1,2 +0,0 @@ -{extends file='014_parent.tpl'} -{block name='title'}child title with - {$smarty.block.child} - here{/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/014_grandchild_smartychild.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/014_grandchild_smartychild.tpl deleted file mode 100644 index d617aaa5..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/014_grandchild_smartychild.tpl +++ /dev/null @@ -1,2 +0,0 @@ -{extends file='014_child_smartychild.tpl'} -{block name='title'}grandchild content{/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/014_parent.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/014_parent.tpl deleted file mode 100644 index afcf7d7c..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/014_parent.tpl +++ /dev/null @@ -1,2 +0,0 @@ -test:{$test nocache} compiled:# rendered:{$test} -{block name='title'}Default Title{/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/015_child.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/015_child.tpl deleted file mode 100644 index 7bd02fa9..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/015_child.tpl +++ /dev/null @@ -1,2 +0,0 @@ -{extends file='015_parent.tpl'} -{block name='title'}Page Title{/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/015_grandchild_append.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/015_grandchild_append.tpl deleted file mode 100644 index 46e912ff..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/015_grandchild_append.tpl +++ /dev/null @@ -1,2 +0,0 @@ -{extends file='015_child.tpl'} -{block name='title' append} - grandchild append{/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/015_parent.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/015_parent.tpl deleted file mode 100644 index afcf7d7c..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/015_parent.tpl +++ /dev/null @@ -1,2 +0,0 @@ -test:{$test nocache} compiled:# rendered:{$test} -{block name='title'}Default Title{/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/016_child_nested.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/016_child_nested.tpl deleted file mode 100644 index 14ffb077..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/016_child_nested.tpl +++ /dev/null @@ -1,2 +0,0 @@ -{extends file='016_parent.tpl'} -{block name='title'}child title with {block name='title_content'}-default-{/block} here{/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/016_grandchild_nested.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/016_grandchild_nested.tpl deleted file mode 100644 index 3f4970a5..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/016_grandchild_nested.tpl +++ /dev/null @@ -1,2 +0,0 @@ -{extends file='016_child_nested.tpl'} -{block name='title_content'}-grandchild content-{/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/016_parent.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/016_parent.tpl deleted file mode 100644 index e63816d2..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/016_parent.tpl +++ /dev/null @@ -1,2 +0,0 @@ -test:{$test nocache} compiled:# rendered:{$test} -{block name='title'}Default Title{/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/017_child_nested.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/017_child_nested.tpl deleted file mode 100644 index d8af5c6d..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/017_child_nested.tpl +++ /dev/null @@ -1,6 +0,0 @@ -{extends file='017_parent.tpl'} -{block name='content1'} - {block name='content2'} - child pre {$smarty.block.child} child post - {/block} -{/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/017_grandchild_nested.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/017_grandchild_nested.tpl deleted file mode 100644 index 9d63a077..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/017_grandchild_nested.tpl +++ /dev/null @@ -1,2 +0,0 @@ -{extends file='017_child_nested.tpl'} -{block name='content2'}-grandchild content-{/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/017_parent.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/017_parent.tpl deleted file mode 100644 index 70c36693..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/017_parent.tpl +++ /dev/null @@ -1,2 +0,0 @@ -test:{$test nocache} compiled:# rendered:{$test} -{block name='content1'}Default content{/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/018_child.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/018_child.tpl new file mode 100644 index 00000000..b0def3a7 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/018_child.tpl @@ -0,0 +1,9 @@ +{extends file="018_parent.tpl"} +{strip} +{block name='b'}(child|b)content + {block name='c'}(child|c)content child c(child|/c) + {/block} + {block name='d' hide}(child|d)content {$smarty.block.child} d(child|/d) + {/block} + b(child|/b) +{/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/018_child_nested_hide.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/018_child_nested_hide.tpl deleted file mode 100644 index bf662b74..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/018_child_nested_hide.tpl +++ /dev/null @@ -1,12 +0,0 @@ -{extends file="018_parent_nested.tpl"} - -{block name="index"} - {block name="test2"} - nested block. - {$smarty.block.child} - {/block} - {block name="test" hide} - I should be hidden. - {$smarty.block.child} - {/block} -{/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/018_grand.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/018_grand.tpl new file mode 100644 index 00000000..867e317c --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/018_grand.tpl @@ -0,0 +1,6 @@ +{extends file="018_child.tpl"} +{strip} +{block name='c' hide}(grand|c)content {$smarty.block.child} c(grand|/c) +{/block} +{block name='d'}(grand|d)content grand d(grand|/d) +{/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/018_grandgrand.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/018_grandgrand.tpl new file mode 100644 index 00000000..fa7035fa --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/018_grandgrand.tpl @@ -0,0 +1,6 @@ +{extends file="018_grand.tpl"} +{strip} +{block name='c'}(grandgrand|c)content grandgrand c(grandgrand|/c) +{/block} +{block name='d'}(grandgrand|d)content grandgrand d(grandgrand|/d) +{/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/018_parent.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/018_parent.tpl new file mode 100644 index 00000000..4fa37768 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/018_parent.tpl @@ -0,0 +1,2 @@ +test:{$test nocache} compiled:# rendered:{$test} +{block name='b'}(parent|b)content parent b(parent|/b){/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/018_parent_nested.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/018_parent_nested.tpl deleted file mode 100644 index b000d4a9..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/018_parent_nested.tpl +++ /dev/null @@ -1,2 +0,0 @@ -test:{$test nocache} compiled:# rendered:{$test} -{block name='index'}{/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/019_child_nested_hide_autoliteral.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/019_child_nested_hide_autoliteral.tpl deleted file mode 100644 index 94a29a52..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/019_child_nested_hide_autoliteral.tpl +++ /dev/null @@ -1,12 +0,0 @@ -{ extends file="019_parent.tpl" } - -{ block name="index" } -{ block name="test2" } -nested block. -{ $smarty.block.child } -{ /block } -{ block name="test" hide } -I should be hidden. -{ $smarty.block.child } -{ /block } -{ /block } \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/019_parent.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/019_parent.tpl deleted file mode 100644 index b000d4a9..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/019_parent.tpl +++ /dev/null @@ -1,2 +0,0 @@ -test:{$test nocache} compiled:# rendered:{$test} -{block name='index'}{/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/020_include_1.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/020_include_1.tpl index 96cb96ca..be9a8b68 100644 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/020_include_1.tpl +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/020_include_1.tpl @@ -1,5 +1,5 @@ {extends file='020_include_parent.tpl'} -{block name="p"}page 1
{/block} +{block name="p"}(include1|p)content 1 p(include1|\p){/block} -{block name="b"}block 1
{/block} \ No newline at end of file +{block name="b"}(include1|b)content 1 b(include1|\b){/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/020_include_2.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/020_include_2.tpl index 4a0115f8..ffa41c6c 100644 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/020_include_2.tpl +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/020_include_2.tpl @@ -1,5 +1,5 @@ {extends file='020_include_parent.tpl'} -{block name="p"}page 2
{/block} +{block name="p"}(include2|p)content 2 p(include2|\p){/block} -{block name="b"}block 2
{/block} \ No newline at end of file +{block name="b"}(include2|b)content 2 b(include2|\b){/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/020_include_3.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/020_include_3.tpl index fbf6a5ad..629e2cac 100644 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/020_include_3.tpl +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/020_include_3.tpl @@ -1,5 +1,5 @@ {extends file='020_include_parent.tpl'} -{block name="p"}page 3
{/block} +{block name="p"}(include3|p)content 3 p(include3|\p){/block} -{block name="b"}block 3
{/block} \ No newline at end of file +{block name="b"}(include3|b)content 3 b(include3|\b){/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/020_include_parent.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/020_include_parent.tpl index eedca930..c9a605b9 100644 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/020_include_parent.tpl +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/020_include_parent.tpl @@ -1,3 +1,4 @@ +{strip} {block name="p"} {/block} {block name='dummy'} {include file='020_include_subtemplate.tpl'} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/020_include_root.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/020_include_root.tpl index a27b2857..2090d4b1 100644 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/020_include_root.tpl +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/020_include_root.tpl @@ -1,5 +1,5 @@ test:{$test nocache} compiled:# rendered:{$test} -{include file='020_include_1.tpl'} -{include file='020_include_2.tpl'} -{include file='020_include_3.tpl'} +(include1){include file='020_include_1.tpl'}(\include1) +(include2){include file='020_include_2.tpl'}(\include2) +(include3){include file='020_include_3.tpl'}(\include3) diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/021_child.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/021_child.tpl index 0bb2dd56..9c1dcc09 100644 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/021_child.tpl +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/021_child.tpl @@ -1,2 +1,2 @@ {extends file='021_parent.tpl'} -{block name='title'}Page Title{/block} +{block name='b' prepend}(child|b)content {$child} b(child|/b){/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/021_grand.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/021_grand.tpl new file mode 100644 index 00000000..7182c6df --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/021_grand.tpl @@ -0,0 +1,2 @@ +{extends file='021_child.tpl'} +{block name='b' prepend}(grand|b)content {$grand} b(grand|/b){/block} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/021_grandchild.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/021_grandchild.tpl deleted file mode 100644 index a700a046..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/021_grandchild.tpl +++ /dev/null @@ -1,2 +0,0 @@ -{extends file='021_child.tpl'} -{block name='title'}Grandchild Page Title{/block} diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/021_parent.tpl b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/021_parent.tpl index e007864b..70ed9c0a 100644 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/021_parent.tpl +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates/021_parent.tpl @@ -1 +1 @@ -{block name='title'}Default Title{/block} +{block name='b'}(parent|b)content {$parent} b(parent|/b){/block} \ No newline at end of file