diff --git a/tests/UnitTests/TemplateSource/TagTests/Capture/CompileCaptureTest.php b/tests/UnitTests/TemplateSource/TagTests/Capture/CompileCaptureTest.php index 9d20f313..c2e9b30a 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Capture/CompileCaptureTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Capture/CompileCaptureTest.php @@ -78,6 +78,13 @@ class CompileCaptureTest extends PHPUnit_Smarty $tpl = $this->smarty->createTemplate('eval:{capture assign=foo}hello {capture assign=bar}this is my {/capture}world{/capture}{$foo} {$bar}'); $this->assertEquals("hello world this is my ", $this->smarty->fetch($tpl), 'This failure pops up only during PHPunit test ?????'); } + /* + * Test that capture results are global + */ + public function testCapture9() + { + $this->assertContains('-->hello world<--', $this->smarty->fetch('009_capture.tpl')); + } public function testCompileCaptureNocache1() { diff --git a/tests/UnitTests/TemplateSource/TagTests/Capture/templates/009_capture.tpl b/tests/UnitTests/TemplateSource/TagTests/Capture/templates/009_capture.tpl new file mode 100644 index 00000000..9526623d --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/Capture/templates/009_capture.tpl @@ -0,0 +1,2 @@ +{capture name='test'}hello world{/capture} +{include '009_capture_include.tpl'} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/Capture/templates/009_capture_include.tpl b/tests/UnitTests/TemplateSource/TagTests/Capture/templates/009_capture_include.tpl new file mode 100644 index 00000000..f88ac6a2 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/Capture/templates/009_capture_include.tpl @@ -0,0 +1 @@ +-->{$smarty.capture.test}<-- \ No newline at end of file