diff options
author | MateBartus <mate.bartus@gmail.com> | 2015-04-14 02:31:23 +0200 |
---|---|---|
committer | MateBartus <mate.bartus@gmail.com> | 2015-05-02 13:37:12 +0200 |
commit | 179a4700221aa49071b07d638c44b9326c7a14a8 (patch) | |
tree | 3dd78a5fb9353afabaa629e8dae58b7f8d99c144 /tests/template/template_test_case.php | |
parent | 2f480be02d25421fa4c372c103604f24d4adf0ab (diff) | |
download | forums-179a4700221aa49071b07d638c44b9326c7a14a8.tar forums-179a4700221aa49071b07d638c44b9326c7a14a8.tar.gz forums-179a4700221aa49071b07d638c44b9326c7a14a8.tar.bz2 forums-179a4700221aa49071b07d638c44b9326c7a14a8.tar.xz forums-179a4700221aa49071b07d638c44b9326c7a14a8.zip |
[ticket/13762] Moving language related functionality into a separate class
PHPBB3-13762
Diffstat (limited to 'tests/template/template_test_case.php')
-rw-r--r-- | tests/template/template_test_case.php | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php index 29ff669efc..7e2020ba09 100644 --- a/tests/template/template_test_case.php +++ b/tests/template/template_test_case.php @@ -15,6 +15,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; class phpbb_template_template_test_case extends phpbb_test_case { + protected $lang; protected $template; protected $template_path; protected $user; @@ -24,6 +25,17 @@ class phpbb_template_template_test_case extends phpbb_test_case // Keep the contents of the cache for debugging? const PRESERVE_CACHE = true; + static protected $language_reflection_lang; + + static public function setUpBeforeClass() + { + parent::setUpBeforeClass(); + + $reflection = new ReflectionClass('\phpbb\language\language'); + self::$language_reflection_lang = $reflection->getProperty('lang'); + self::$language_reflection_lang->setAccessible(true); + } + protected function display($handle) { ob_start(); @@ -65,7 +77,10 @@ class phpbb_template_template_test_case extends phpbb_test_case $defaults = $this->config_defaults(); $config = new \phpbb\config\config(array_merge($defaults, $new_config)); - $this->user = new \phpbb\user('\phpbb\datetime'); + $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); + $this->lang = $lang = new \phpbb\language\language($lang_loader); + $user = new \phpbb\user($lang, '\phpbb\datetime'); + $this->user = $user; $path_helper = new \phpbb\path_helper( new \phpbb\symfony_request( @@ -145,7 +160,10 @@ class phpbb_template_template_test_case extends phpbb_test_case { foreach ($lang_vars as $name => $value) { - $this->user->lang[$name] = $value; + self::$language_reflection_lang->setValue($this->lang, array_merge( + self::$language_reflection_lang->getValue($this->lang), + array($name => $value) + )); } } |