Update {extends} test

This commit is contained in:
uwetews
2016-04-13 03:30:32 +02:00
parent b08b8f1d3a
commit 66f6c54281
5 changed files with 22 additions and 0 deletions

View File

@@ -909,4 +909,16 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty
$this->smarty->assign('bar', 'bar'); $this->smarty->assign('bar', 'bar');
$this->assertContains('bar', $this->smarty->fetch('031_post_filter.tpl')); $this->assertContains('bar', $this->smarty->fetch('031_post_filter.tpl'));
} }
/*
* Test new inheritance root in outermost include
*/
public function testInclude_032()
{
$result = $this->smarty->fetch('032_child.tpl');
$this->assertContains('foo in 032_child.tpl', $result);
$this->assertContains('bar in 032_included_child.tpl', $result);
$this->assertContains('foo in 032_included_parent.tpl', $result);
$this->assertNotContains('bar in 032_included_parent.tpl', $result);
$this->assertNotContains('foo in 032_parent.tpl', $result);
}
} }

View File

@@ -0,0 +1,3 @@
{extends "032_parent.tpl"}
{block "foo"}foo in 032_child.tpl{/block}

View File

@@ -0,0 +1,3 @@
{extends file="032_included_parent.tpl"}
{block "bar"}bar in 032_included_child.tpl{/block}

View File

@@ -0,0 +1,2 @@
{block "bar"}bar in 032_included_parent.tpl{/block}
{block "foo"}foo in 032_included_parent.tpl{/block}

View File

@@ -0,0 +1,2 @@
{include file="032_included_child.tpl"}
{block "foo"}foo in 032_parent.tpl{/block}