aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functions_acp
diff options
context:
space:
mode:
authorSenky <jakubsenko@gmail.com>2013-02-06 23:02:53 +0100
committerSenky <jakubsenko@gmail.com>2013-05-20 18:41:34 +0200
commit77ae733918d47b12f65a13fb58df03e2c8a3e621 (patch)
tree4d9fdaf6d30c7ebabcc5538564ea10c5fa750ecf /tests/functions_acp
parent6c0f3513d99c3af965bdc8a03b2bae9978477c27 (diff)
downloadforums-77ae733918d47b12f65a13fb58df03e2c8a3e621.tar
forums-77ae733918d47b12f65a13fb58df03e2c8a3e621.tar.gz
forums-77ae733918d47b12f65a13fb58df03e2c8a3e621.tar.bz2
forums-77ae733918d47b12f65a13fb58df03e2c8a3e621.tar.xz
forums-77ae733918d47b12f65a13fb58df03e2c8a3e621.zip
[ticket/11010] fixing tests
PHPBB3-11010
Diffstat (limited to 'tests/functions_acp')
-rw-r--r--tests/functions_acp/build_cfg_template_test.php40
1 files changed, 38 insertions, 2 deletions
diff --git a/tests/functions_acp/build_cfg_template_test.php b/tests/functions_acp/build_cfg_template_test.php
index 32980d97ce..3159aabaa1 100644
--- a/tests/functions_acp/build_cfg_template_test.php
+++ b/tests/functions_acp/build_cfg_template_test.php
@@ -64,7 +64,7 @@ class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case
array('config_key_name_width' => 10, 'config_key_name_height' => 20),
'config_key_name',
array(),
- '<input id="number_key_name" type="number" size="20" maxlength="15" max="999999999999999" name="config[config_key_name_width]" value="10" /> x <input type="text" size="20" maxlength="255" name="config[config_key_name_height]" value="20" />',
+ '<input id="number_key_name" type="number" maxlength="2" min="5" max="15" name="config[config_key_name_width]" value="10" /> x <input type="number" maxlength="2" min="5" max="15" name="config[config_key_name_height]" value="20" />',
),
array(
array('dimension', 0, 15),
@@ -72,7 +72,7 @@ class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case
array('config_key_name_width' => 10, 'config_key_name_height' => 20),
'config_key_name',
array(),
- '<input id="number_key_name" type="number" maxlength="15" max="999999999999999" name="config[config_key_name_width]" value="10" /> x <input type="text" maxlength="255" name="config[config_key_name_height]" value="20" />',
+ '<input id="number_key_name" type="number" maxlength="2" min="0" max="15" name="config[config_key_name_width]" value="10" /> x <input type="number" maxlength="2" min="0" max="15" name="config[config_key_name_height]" value="20" />',
),
);
}
@@ -91,6 +91,42 @@ class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case
$this->assertEquals($expected, build_cfg_template($tpl_type, $key, $new, $config_key, $vars));
}
+ public function build_cfg_template_number_data()
+ {
+ return array(
+ array(
+ array('number', 5, 15),
+ 'number_key_name',
+ array('config_key_name' => 10),
+ 'config_key_name',
+ array(),
+ '<input id="number_key_name" type="number" maxlength="2" min="5" max="15" name="config[config_key_name]" value="10" />',
+ ),
+ array(
+ array('number', -1, 9999),
+ 'number_key_name',
+ array('config_key_name' => 10),
+ 'config_key_name',
+ array(),
+ '<input id="number_key_name" type="number" maxlength="4" min="-1" max="9999" name="config[config_key_name]" value="10" />',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider build_cfg_template_number_data
+ */
+ public function test_build_cfg_template_number($tpl_type, $key, $new, $config_key, $vars, $expected)
+ {
+ global $user, $phpbb_dispatcher;
+
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $user = new phpbb_mock_user();
+ $user->lang = new phpbb_mock_lang();
+
+ $this->assertEquals($expected, build_cfg_template($tpl_type, $key, $new, $config_key, $vars));
+ }
+
public function build_cfg_template_textarea_data()
{
return array(