mirror of
https://github.com/smarty-php/smarty.git
synced 2026-05-04 11:44:16 +02:00
Added variable scope test for multi-level extends resource
This commit is contained in:
@@ -91,6 +91,23 @@ class ExtendsResourceTest extends PHPUnit_Smarty
|
||||
$this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data
|
||||
*/
|
||||
public function testCompileBlockIncreaseInChild_050($caching, $merge, $testNumber, $compileTestNumber, $renderTestNumber, $testName)
|
||||
{
|
||||
$this->smarty->registerFilter('pre', array($this, 'compiledPrefilter'));
|
||||
$this->smarty->assign('test', $testNumber);
|
||||
$this->smarty->caching = $caching;
|
||||
$this->smarty->merge_compiled_includes = $merge;
|
||||
if ($merge) {
|
||||
$this->smarty->compile_id = 1;
|
||||
}
|
||||
$result = $this->smarty->fetch('extends:050_parent.tpl|050_child.tpl|050_grandchild.tpl');
|
||||
$this->assertStringContainsString("var-bar-var", $result, $testName . ' - content');
|
||||
$this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure');
|
||||
}
|
||||
|
||||
/**
|
||||
* test grandchild/child/parent dependency test1
|
||||
* @runInSeparateProcess
|
||||
@@ -259,7 +276,7 @@ class ExtendsResourceTest extends PHPUnit_Smarty
|
||||
*/
|
||||
array(false, false, 1, 1, 1, 'no caching, no merge - new'),
|
||||
array(false, false, 2, 1, 2, 'no caching, no merge - exits'),
|
||||
array(true, false, 3, 3, 3, 'caching, no merge - new'),
|
||||
array(true, false, 3, 3, 3, 'caching, no merge - new'), // 2
|
||||
array(true, false, 4, 3, 3, 'caching, no merge - exits'),
|
||||
array(false, true, 5, 5, 5, 'no caching, merge - new'),
|
||||
array(false, true, 6, 5, 6, 'no caching, merge - exits'),
|
||||
|
||||
Reference in New Issue
Block a user