1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-05 08:17:47 +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

@@ -23,23 +23,27 @@ class phpbb_functions_validate_match_test extends phpbb_test_case
public function test_validate_match()
{
$this->helper->assert_validate_data(array(
'empty_opt' => array(),
'empty_empty_match' => array(),
'foobar' => array(),
'foobar_fail' => array('WRONG_DATA'),
),
array(
'empty_opt' => '',
'empty_empty_match' => '',
'foobar' => 'foobar',
'foobar_fail' => 'foobar123',
),
array(
'empty_opt' => array('match', true, '/[a-z]$/'),
'empty_empty_match' => array('match'),
'foobar' => array('match', false, '/[a-z]$/'),
'foobar_fail' => array('match', false, '/[a-z]$/'),
$this->helper->assert_valid_data(array(
'empty_opt' => array(
array(),
'',
array('match', true, '/[a-z]$/'),
),
'empty_empty_match' => array(
array(),
'',
array('match'),
),
'foobar' => array(
array(),
'foobar',
array('match', false, '/[a-z]$/'),
),
'foobar_fail' => array(
array('WRONG_DATA'),
'foobar123',
array('match', false, '/[a-z]$/'),
),
));
}
}