This commit is contained in:
uwetews
2015-12-24 06:27:11 +01:00
parent b4613146b4
commit 6b9648a1dc
2 changed files with 18 additions and 1 deletions

View File

@@ -18,6 +18,7 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty
public function setUp() public function setUp()
{ {
$this->setUpSmarty(__DIR__); $this->setUpSmarty(__DIR__);
//$this->smarty->setMergeCompiledIncludes(true);
} }
@@ -465,7 +466,7 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty
/** /**
* test grandchild/child/parent template chain with nested {$this->smarty.block.child} and {include nocache} * test grandchild/child/parent template chain with nested {$this->smarty.block.child} and {include nocache}
* @run InSeparateProcess * @runInSeparateProcess
* @preserveGlobalState disabled * @preserveGlobalState disabled
* @dataProvider data * @dataProvider data
*/ */
@@ -714,4 +715,19 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty
array(true, true, 8, 7, 7, 'caching, merge - exits'), array(true, true, 8, 7, 7, 'caching, merge - exits'),
); );
} }
/*
* Test post filter on {block}
*/
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'));
}
} }

View File

@@ -0,0 +1 @@
{block name='title'}{$foo}{/block}