1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-28 04:20:32 +02:00

[ticket/11579] Rework calls to validate_data_helper

PHPBB3-11579
This commit is contained in:
Marc Alexander
2013-06-03 21:30:13 +02:00
parent c2bc82ebfd
commit 11678678b8
10 changed files with 344 additions and 232 deletions

View File

@@ -24,35 +24,47 @@ class phpbb_functions_validate_string_test extends phpbb_test_case
public function test_validate_string()
{
$this->helper->assert_validate_data(array(
'empty_opt' => array(),
'empty' => array(),
'foo' => array(),
'foo_minmax_correct' => array(),
'foo_minmax_short' => array('TOO_SHORT'),
'foo_minmax_long' => array('TOO_LONG'),
'empty_short' => array('TOO_SHORT'),
'empty_length_opt' => array(),
),
array(
'empty_opt' => '',
'empty' => '',
'foo' => 'foobar',
'foo_minmax_correct' => 'foobar',
'foo_minmax_short' => 'foobar',
'foo_minmax_long' => 'foobar',
'empty_short' => '',
'empty_length_opt' => '',
),
array(
'empty_opt' => array('string', true),
'empty' => array('string'),
'foo' => array('string'),
'foo_minmax_correct' => array('string', false, 2, 6),
'foo_minmax_short' => array('string', false, 7, 9),
'foo_minmax_long' => array('string', false, 2, 5),
'empty_short' => array('string', false, 1, 6),
'empty_length_opt' => array('string', true, 1, 6),
$this->helper->assert_valid_data(array(
'empty_opt' => array(
array(),
'',
array('string', true),
),
'empty' => array(
array(),
'',
array('string'),
),
'foo' => array(
array(),
'foobar',
array('string'),
),
'foo_minmax_correct' => array(
array(),
'foobar',
array('string', false, 2, 6),
),
'foo_minmax_short' => array(
array('TOO_SHORT'),
'foobar',
array('string', false, 7, 9),
),
'foo_minmax_long' => array(
array('TOO_LONG'),
'foobar',
array('string', false, 2, 5),
),
'empty_short' => array(
array('TOO_SHORT'),
'',
array('string', false, 1, 6),
),
'empty_length_opt' => array(
array(),
'',
array('string', true, 1, 6),
),
));
}
}