mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
add a couple more tests
This commit is contained in:
1
unit_test/configs/globals_double_quotes.conf
Normal file
1
unit_test/configs/globals_double_quotes.conf
Normal file
@@ -0,0 +1 @@
|
|||||||
|
foo = "bar"
|
1
unit_test/configs/globals_single_quotes.conf
Normal file
1
unit_test/configs/globals_single_quotes.conf
Normal file
@@ -0,0 +1 @@
|
|||||||
|
foo = 'bar'
|
@@ -228,6 +228,23 @@ class SmartyTest extends PHPUnit_TestCase {
|
|||||||
$this->assertEquals($this->smarty->fetch('assign_var.tpl'), 'bar');
|
$this->assertEquals($this->smarty->fetch('assign_var.tpl'), 'bar');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* CONFIG FILE TESTS */
|
||||||
|
|
||||||
|
// test assigning a quoted global variable
|
||||||
|
function test_config_load_globals_double_quotes() {
|
||||||
|
// load the global var
|
||||||
|
$this->smarty->config_load('globals_double_quotes.conf');
|
||||||
|
// test that it is assigned
|
||||||
|
$this->assertEquals($this->smarty->_config[0]['vars']['foo'], 'bar');
|
||||||
|
}
|
||||||
|
|
||||||
|
// test assigning a quoted global
|
||||||
|
function test_config_load_globals_single_quotes() {
|
||||||
|
// load the global var
|
||||||
|
$this->smarty->config_load('globals_single_quotes.conf');
|
||||||
|
// test that it is assigned
|
||||||
|
$this->assertEquals($this->smarty->_config[0]['vars']['foo'], 'bar');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
Reference in New Issue
Block a user