aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functions_acp
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2013-11-22 15:51:22 +0100
committerJoas Schilling <nickvergessen@gmx.de>2013-11-22 15:51:22 +0100
commit8c73c9658e70f8cbdf52a89899f4fc094586b229 (patch)
tree78b18c5251e77c9888d92087a5afc09c7618fbf6 /tests/functions_acp
parent9861cd21dd1e60943dbba7d5b2dc64c272ccd20d (diff)
downloadforums-8c73c9658e70f8cbdf52a89899f4fc094586b229.tar
forums-8c73c9658e70f8cbdf52a89899f4fc094586b229.tar.gz
forums-8c73c9658e70f8cbdf52a89899f4fc094586b229.tar.bz2
forums-8c73c9658e70f8cbdf52a89899f4fc094586b229.tar.xz
forums-8c73c9658e70f8cbdf52a89899f4fc094586b229.zip
[ticket/10910] Fix unit tests
PHPBB3-10910
Diffstat (limited to 'tests/functions_acp')
-rw-r--r--tests/functions_acp/build_cfg_template_test.php25
1 files changed, 20 insertions, 5 deletions
diff --git a/tests/functions_acp/build_cfg_template_test.php b/tests/functions_acp/build_cfg_template_test.php
index d4bd80e4c2..7f8db799c5 100644
--- a/tests/functions_acp/build_cfg_template_test.php
+++ b/tests/functions_acp/build_cfg_template_test.php
@@ -243,16 +243,16 @@ class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case
'key_name',
array('config_key_name' => '0'),
'config_key_name',
- array(),
- '<select name="config[config_key_name]" id="key_name"><option value="1">First_Option</option><option value="2" selected="selected">Second_Option</option><option value="3">Third_Option</option></select>',
+ array('method' => 'select_helper'),
+ '<select id="key_name" name="config[config_key_name]"><option value="1">First_Option</option><option value="2" selected="selected">Second_Option</option><option value="3">Third_Option</option></select>',
),
array(
array('select', 8),
'key_name',
array('config_key_name' => '1'),
'config_key_name',
- array(),
- '<select name="config[config_key_name]" id="key_name" size="8"><option value="1">First_Option</option><option value="2" selected="selected">Second_Option</option><option value="3">Third_Option</option></select>',
+ array('method' => 'select_helper'),
+ '<select id="key_name" name="config[config_key_name]" size="8"><option value="1">First_Option</option><option value="2" selected="selected">Second_Option</option><option value="3">Third_Option</option></select>',
),
);
}
@@ -262,11 +262,26 @@ class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case
*/
public function test_build_cfg_template_select($tpl_type, $key, $new, $config_key, $vars, $expected)
{
- global $user, $phpbb_dispatcher;
+ global $module, $user, $phpbb_dispatcher;
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $user = new phpbb_mock_user();
$user->lang = new phpbb_mock_lang();
+ $user->module = $this;
+ $module = $user;
$this->assertEquals($expected, build_cfg_template($tpl_type, $key, $new, $config_key, $vars));
}
+
+ public function select_helper()
+ {
+ return build_select(
+ array(
+ '1' => 'First_Option',
+ '2' => 'Second_Option',
+ '3' => 'Third_Option',
+ ),
+ '2'
+ );
+ }
}