Skip to content

Commit

Permalink
add post filter test #144
Browse files Browse the repository at this point in the history
  • Loading branch information
uwetews committed Dec 24, 2015
1 parent b461314 commit 6b9648a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty
public function setUp()
{
$this->setUpSmarty(__DIR__);
//$this->smarty->setMergeCompiledIncludes(true);
}


Expand Down Expand Up @@ -465,7 +466,7 @@ public function testCompileBlockStartSubTemplates_020($caching, $merge, $testNum

/**
* test grandchild/child/parent template chain with nested {$this->smarty.block.child} and {include nocache}
* @run InSeparateProcess
* @runInSeparateProcess
* @preserveGlobalState disabled
* @dataProvider data
*/
Expand Down Expand Up @@ -714,4 +715,19 @@ public function data(){
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'));

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{block name='title'}{$foo}{/block}

0 comments on commit 6b9648a

Please sign in to comment.