mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
add {extends} tests with relative path
This commit is contained in:
@@ -850,6 +850,29 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty
|
||||
$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 testCompileBlockGrandChildNestedRelative_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('sub/030_grandchild_nested_rel.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()
|
||||
{
|
||||
|
@@ -0,0 +1,6 @@
|
||||
{extends file='../030_parent.tpl'}
|
||||
{block name='content1'}
|
||||
{block name='content2'}
|
||||
child pre {$smarty.block.child} child post {include file='../030_include.tpl' nocache}
|
||||
{/block}
|
||||
{/block}
|
@@ -0,0 +1,2 @@
|
||||
{extends file='./030_child_nested_rel.tpl'}
|
||||
{block name='content2'}-grandchild content-{/block}
|
Reference in New Issue
Block a user