mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 10:54:27 +02:00
add test for config variable overloading
This commit is contained in:
@@ -109,7 +109,17 @@ class CompileConfigLoadTest extends PHPUnit_Smarty
|
||||
*/
|
||||
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]
|
||||
sec1 = Hello Section1
|
||||
|
||||
[default]
|
||||
title = Welcome to overwrite test!
|
||||
over = shall not show
|
||||
|
||||
[section2]
|
||||
sec2 = 'Hello Section2'
|
||||
|
||||
|
@@ -1,2 +1,5 @@
|
||||
|
||||
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