mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 19:04:27 +02:00
add test for config variable overloading
This commit is contained in:
@@ -104,12 +104,22 @@ class CompileConfigLoadTest extends PHPUnit_Smarty
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @runInSeparateProcess
|
* @run InSeparateProcess
|
||||||
* @preserveGlobalState disabled
|
* @preserveGlobalState disabled
|
||||||
*/
|
*/
|
||||||
public function testConfigVariableOverwrite_006()
|
public function testConfigVariableOverwrite_006()
|
||||||
{
|
{
|
||||||
$this->assertEquals("Overwrite3", $this->smarty->fetch('006_overwrite.tpl'));
|
$this->assertEquals("Welcome to Smarty! Overwrite3", $this->smarty->fetch('006_overwrite.tpl'));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @run InSeparateProcess
|
||||||
|
* @preserveGlobalState disabled
|
||||||
|
*/
|
||||||
|
public function testConfigVariableOverwrite_0061()
|
||||||
|
{
|
||||||
|
$this->smarty->configLoad('test.conf', 'default');
|
||||||
|
$this->smarty->configLoad('test2.conf', 'default');
|
||||||
|
$this->assertEquals('Welcome to overwrite test! this overwitten', $this->smarty->fetch('0061_overwrite.tpl'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -29,6 +29,10 @@ sec = section foo/bar
|
|||||||
[section1]
|
[section1]
|
||||||
sec1 = Hello Section1
|
sec1 = Hello Section1
|
||||||
|
|
||||||
|
[default]
|
||||||
|
title = Welcome to overwrite test!
|
||||||
|
over = shall not show
|
||||||
|
|
||||||
[section2]
|
[section2]
|
||||||
sec2 = 'Hello Section2'
|
sec2 = 'Hello Section2'
|
||||||
|
|
||||||
|
@@ -1,2 +1,5 @@
|
|||||||
|
|
||||||
overwrite = Overwrite3
|
overwrite = Overwrite3
|
||||||
|
|
||||||
|
[default]
|
||||||
|
over = this overwitten
|
@@ -0,0 +1 @@
|
|||||||
|
{#title#} {#over#}
|
@@ -1 +1 @@
|
|||||||
{config_load 'test.conf'}{config_load 'test2.conf'}{#overwrite#}
|
{config_load 'test.conf'}{config_load 'test2.conf'}{#title#} {#overwrite#}
|
Reference in New Issue
Block a user