diff --git a/tests/UnitTests/TemplateSource/TagTests/BlockPlugin/CompileBlockPluginTest.php b/tests/UnitTests/TemplateSource/TagTests/BlockPlugin/CompileBlockPluginTest.php index ccc3fc51..c7226f03 100644 --- a/tests/UnitTests/TemplateSource/TagTests/BlockPlugin/CompileBlockPluginTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/BlockPlugin/CompileBlockPluginTest.php @@ -252,6 +252,18 @@ class CompileBlockPluginTest extends PHPUnit_Smarty $this->smarty->registerDefaultPluginHandler('my_block_plugin_handler'); $this->assertEquals('defaultblock hello world', $this->smarty->fetch('default2.tpl')); } + /** + * test tag stack + * + * @run InSeparateProcess + * @preserveGlobalState disabled + * + */ + public function testBlockPluginTagStack() + { + $this->assertEquals('noop-teststack', $this->smarty->fetch('tag_stack.tpl')); + $this->assertEmpty($this->smarty->_cache['_tag_stack']); + } /** * Test caching diff --git a/tests/UnitTests/TemplateSource/TagTests/BlockPlugin/PHPunitplugins/block.noop.php b/tests/UnitTests/TemplateSource/TagTests/BlockPlugin/PHPunitplugins/block.noop.php new file mode 100644 index 00000000..0e163e59 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/BlockPlugin/PHPunitplugins/block.noop.php @@ -0,0 +1,24 @@ +smarty->_cache['_tag_stack']; + return $stack[0][0] . '-' . $stack[1][0]; + } +} diff --git a/tests/UnitTests/TemplateSource/TagTests/BlockPlugin/templates/tag_stack.tpl b/tests/UnitTests/TemplateSource/TagTests/BlockPlugin/templates/tag_stack.tpl new file mode 100644 index 00000000..6cbc1404 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/BlockPlugin/templates/tag_stack.tpl @@ -0,0 +1 @@ +{noop}{teststack}{/teststack}{/noop} \ No newline at end of file