mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 10:24:26 +02:00
add test for chained prepend
This commit is contained in:
@@ -292,7 +292,26 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty
|
||||
$this->smarty->compile_id = 1;
|
||||
}
|
||||
$result = $this->smarty->fetch('013_grandchild_prepend.tpl');
|
||||
$this->assertContains('grandchild prepend - Page Title', $result, $testName . ' - content');
|
||||
$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');
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,2 @@
|
||||
{extends file='013_parent.tpl'}
|
||||
{block name='title' prepend}child prepend - {/block}
|
@@ -0,0 +1,2 @@
|
||||
{extends file='013_2_child_prepend.tpl'}
|
||||
{block name='title' prepend}grandchild prepend - {/block}
|
@@ -1,2 +1,2 @@
|
||||
{extends file='013_parent.tpl'}
|
||||
{block name='title'}Page Title{/block}
|
||||
{block name='title'}child{/block}
|
||||
|
@@ -1,2 +1,2 @@
|
||||
test:{$test nocache} compiled:# rendered:{$test}
|
||||
{block name='title'}Default Title{/block}
|
||||
{block name='title'}parent{/block}
|
||||
|
Reference in New Issue
Block a user