mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-24 12:03:21 +01:00
[ticket/12514] Fix some formatting for tests
PHPBB3-12514
This commit is contained in:
parent
f549a6ce9f
commit
e820143e87
@ -73,12 +73,12 @@ class phpbb_profilefield_type_bool_test extends phpbb_test_case
|
|||||||
public function validate_profile_field_data()
|
public function validate_profile_field_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array(
|
array(
|
||||||
false,
|
false,
|
||||||
array('field_required' => true),
|
array('field_required' => true),
|
||||||
'FIELD_REQUIRED-field',
|
'FIELD_REQUIRED-field',
|
||||||
'Field should not accept empty values for required fields',
|
'Field should not accept empty values for required fields',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,24 +97,24 @@ class phpbb_profilefield_type_bool_test extends phpbb_test_case
|
|||||||
public function profile_value_data()
|
public function profile_value_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array(
|
array(
|
||||||
false,
|
false,
|
||||||
array('field_show_novalue' => true),
|
array('field_show_novalue' => true),
|
||||||
'No',
|
'No',
|
||||||
'Field should output the default value',
|
'Field should output the default value',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
false,
|
false,
|
||||||
array('field_show_novalue' => false, 'field_length' => 2),
|
array('field_show_novalue' => false, 'field_length' => 2),
|
||||||
null,
|
null,
|
||||||
'Field should not show anything for empty value',
|
'Field should not show anything for empty value',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
0,
|
0,
|
||||||
array(),
|
array(),
|
||||||
'Yes',
|
'Yes',
|
||||||
'Field should show the set value',
|
'Field should show the set value',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,22 +63,22 @@ class phpbb_profilefield_type_date_test extends phpbb_test_case
|
|||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array(
|
array(
|
||||||
'01-01-2009',
|
'01-01-2009',
|
||||||
array('field_show_novalue' => true),
|
array('field_show_novalue' => true),
|
||||||
'01/01/2009',
|
'01/01/2009',
|
||||||
'Field should output the correctly formatted date',
|
'Field should output the correctly formatted date',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
null,
|
null,
|
||||||
array('field_show_novalue' => false),
|
array('field_show_novalue' => false),
|
||||||
null,
|
null,
|
||||||
'Field should leave empty value as is',
|
'Field should leave empty value as is',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'None',
|
'None',
|
||||||
array('field_show_novalue' => true),
|
array('field_show_novalue' => true),
|
||||||
'None',
|
'None',
|
||||||
'Field should leave invalid value as is',
|
'Field should leave invalid value as is',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -99,71 +99,71 @@ class phpbb_profilefield_type_date_test extends phpbb_test_case
|
|||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array(
|
array(
|
||||||
'',
|
'',
|
||||||
array('field_required' => true),
|
array('field_required' => true),
|
||||||
'FIELD_REQUIRED-field',
|
'FIELD_REQUIRED-field',
|
||||||
'Field should reject value for being empty',
|
'Field should reject value for being empty',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'0125',
|
'0125',
|
||||||
array('field_required' => true),
|
array('field_required' => true),
|
||||||
'FIELD_REQUIRED-field',
|
'FIELD_REQUIRED-field',
|
||||||
'Field should reject value for being invalid',
|
'Field should reject value for being invalid',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'01-01-2012',
|
'01-01-2012',
|
||||||
array(),
|
array(),
|
||||||
false,
|
false,
|
||||||
'Field should accept a valid value',
|
'Field should accept a valid value',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'40-05-2009',
|
'40-05-2009',
|
||||||
array(),
|
array(),
|
||||||
'FIELD_INVALID_DATE-field',
|
'FIELD_INVALID_DATE-field',
|
||||||
'Field should reject value for being invalid',
|
'Field should reject value for being invalid',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'12-30-2012',
|
'12-30-2012',
|
||||||
array(),
|
array(),
|
||||||
'FIELD_INVALID_DATE-field',
|
'FIELD_INVALID_DATE-field',
|
||||||
'Field should reject value for being invalid',
|
'Field should reject value for being invalid',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'string',
|
'string',
|
||||||
array(),
|
array(),
|
||||||
false,
|
false,
|
||||||
'Field should reject value for being invalid',
|
'Field should reject value for being invalid',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'string',
|
'string',
|
||||||
array('field_required' => true),
|
array('field_required' => true),
|
||||||
'FIELD_REQUIRED-field',
|
'FIELD_REQUIRED-field',
|
||||||
'Field should reject value for being invalid',
|
'Field should reject value for being invalid',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
100,
|
100,
|
||||||
array(),
|
array(),
|
||||||
false,
|
false,
|
||||||
'Field should reject value for being invalid',
|
'Field should reject value for being invalid',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
100,
|
100,
|
||||||
array('field_required' => true),
|
array('field_required' => true),
|
||||||
'FIELD_REQUIRED-field',
|
'FIELD_REQUIRED-field',
|
||||||
'Field should reject value for being invalid',
|
'Field should reject value for being invalid',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
null,
|
null,
|
||||||
array('field_required' => true),
|
array('field_required' => true),
|
||||||
'FIELD_REQUIRED-field',
|
'FIELD_REQUIRED-field',
|
||||||
'Field should reject value for being empty',
|
'Field should reject value for being empty',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
true,
|
true,
|
||||||
array('field_required' => true),
|
array('field_required' => true),
|
||||||
'FIELD_REQUIRED-field',
|
'FIELD_REQUIRED-field',
|
||||||
'Field should reject value for being empty',
|
'Field should reject value for being empty',
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,30 +76,30 @@ class phpbb_profilefield_type_dropdown_test extends phpbb_test_case
|
|||||||
public function validate_profile_field_data()
|
public function validate_profile_field_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array(
|
array(
|
||||||
7,
|
7,
|
||||||
array(),
|
array(),
|
||||||
'FIELD_INVALID_VALUE-field',
|
'FIELD_INVALID_VALUE-field',
|
||||||
'Invalid value should throw error',
|
'Invalid value should throw error',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
2,
|
2,
|
||||||
array(),
|
array(),
|
||||||
false,
|
false,
|
||||||
'Valid value should not throw error'
|
'Valid value should not throw error'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
0,
|
0,
|
||||||
array(),
|
array(),
|
||||||
false,
|
false,
|
||||||
'Empty value should be acceptible',
|
'Empty value should be acceptible',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
0,
|
0,
|
||||||
array('field_required' => true),
|
array('field_required' => true),
|
||||||
'FIELD_REQUIRED-field',
|
'FIELD_REQUIRED-field',
|
||||||
'Required field should not accept empty value',
|
'Required field should not accept empty value',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,28 +119,28 @@ class phpbb_profilefield_type_dropdown_test extends phpbb_test_case
|
|||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array(
|
array(
|
||||||
1,
|
1,
|
||||||
array('field_show_novalue' => true),
|
array('field_show_novalue' => true),
|
||||||
'Option 1',
|
'Option 1',
|
||||||
'Field should output the given value',
|
'Field should output the given value',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
4,
|
4,
|
||||||
array('field_show_novalue' => false),
|
array('field_show_novalue' => false),
|
||||||
'Option 4',
|
'Option 4',
|
||||||
'Field should output the given value',
|
'Field should output the given value',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'',
|
'',
|
||||||
array('field_show_novalue' => true),
|
array('field_show_novalue' => true),
|
||||||
'<No Value>',
|
'<No Value>',
|
||||||
'Field should output nothing for empty value',
|
'Field should output nothing for empty value',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'',
|
'',
|
||||||
array('field_show_novalue' => false),
|
array('field_show_novalue' => false),
|
||||||
null,
|
null,
|
||||||
'Field should simply output null for empty value',
|
'Field should simply output null for empty value',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -55,39 +55,39 @@ class phpbb_profilefield_type_url_test extends phpbb_test_case
|
|||||||
return array(
|
return array(
|
||||||
array(
|
array(
|
||||||
'',
|
'',
|
||||||
array('field_required' => true),
|
array('field_required' => true),
|
||||||
'FIELD_INVALID_URL-field',
|
'FIELD_INVALID_URL-field',
|
||||||
'Field should reject empty field that is required',
|
'Field should reject empty field that is required',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'invalidURL',
|
'invalidURL',
|
||||||
array(),
|
array(),
|
||||||
'FIELD_INVALID_URL-field',
|
'FIELD_INVALID_URL-field',
|
||||||
'Field should reject invalid input',
|
'Field should reject invalid input',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'http://onetwothree.example.io',
|
'http://onetwothree.example.io',
|
||||||
array(),
|
array(),
|
||||||
false,
|
false,
|
||||||
'Field should accept valid URL',
|
'Field should accept valid URL',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'http://example.com/index.html?param1=test¶m2=awesome',
|
'http://example.com/index.html?param1=test¶m2=awesome',
|
||||||
array(),
|
array(),
|
||||||
false,
|
false,
|
||||||
'Field should accept valid URL',
|
'Field should accept valid URL',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'http://example.com/index.html/test/path?document=get',
|
'http://example.com/index.html/test/path?document=get',
|
||||||
array(),
|
array(),
|
||||||
false,
|
false,
|
||||||
'Field should accept valid URL',
|
'Field should accept valid URL',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'http://example.com/index.html/test/path?document[]=DocType%20test&document[]=AnotherDoc',
|
'http://example.com/index.html/test/path?document[]=DocType%20test&document[]=AnotherDoc',
|
||||||
array(),
|
array(),
|
||||||
'FIELD_INVALID_URL-field',
|
'FIELD_INVALID_URL-field',
|
||||||
'Field should reject invalid URL having multi value parameters',
|
'Field should reject invalid URL having multi value parameters',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user