1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-24 12:03:21 +01:00

[ticket/12514] Fix type_int_test to correctly respect boundaries

PHPBB3-12514
This commit is contained in:
Shitiz Garg 2014-06-14 14:27:23 +05:30
parent 995690e192
commit 2fc5c51d9a

View File

@ -114,29 +114,22 @@ class phpbb_profilefield_type_int_test extends phpbb_test_case
{ {
return array( return array(
array( array(
'124', '15',
array('field_minlen' => 2, 'field_maxlen' => 4, 'field_required' => true), array('field_minlen' => 10, 'field_maxlen' => 20, 'field_required' => true),
false, false,
'Field should accept input of correct length', 'Field should accept input of correct boundaries',
), ),
array( array(
'556476', '556476',
array('field_maxlen' => 4, 'field_required' => true), array('field_maxlen' => 50000, 'field_required' => true),
'FIELD_TOO_LARGE-4-field', 'FIELD_TOO_LARGE-50000-field',
'Field should reject value of greater length', 'Field should reject value of greater value than max',
), ),
array( array(
'9', '9',
array('field_minlen' => 2, 'field_required' => true), array('field_minlen' => 10, 'field_required' => true),
'FIELD_TOO_SMALL-2-field', 'FIELD_TOO_SMALL-10-field',
'Field should reject value which is less than defined minlength', 'Field should reject value which is less than defined minimum',
),
array(
'',
array('field_required' => true),
'FIELD_REQUIRED-field',
'Field should reject value for being empty',
), ),
); );
} }