mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
Update {extends} test
This commit is contained in:
@@ -909,4 +909,16 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty
|
||||
$this->smarty->assign('bar', 'bar');
|
||||
$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);
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,3 @@
|
||||
{extends "032_parent.tpl"}
|
||||
|
||||
{block "foo"}foo in 032_child.tpl{/block}
|
@@ -0,0 +1,3 @@
|
||||
{extends file="032_included_parent.tpl"}
|
||||
|
||||
{block "bar"}bar in 032_included_child.tpl{/block}
|
@@ -0,0 +1,2 @@
|
||||
{block "bar"}bar in 032_included_parent.tpl{/block}
|
||||
{block "foo"}foo in 032_included_parent.tpl{/block}
|
@@ -0,0 +1,2 @@
|
||||
{include file="032_included_child.tpl"}
|
||||
{block "foo"}foo in 032_parent.tpl{/block}
|
Reference in New Issue
Block a user