1
0
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:
Shitiz Garg 2014-06-18 01:45:08 +05:30
parent f549a6ce9f
commit e820143e87
4 changed files with 112 additions and 112 deletions

View File

@ -73,12 +73,12 @@ class phpbb_profilefield_type_bool_test extends phpbb_test_case
public function validate_profile_field_data()
{
return array(
array(
array(
false,
array('field_required' => true),
'FIELD_REQUIRED-field',
'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()
{
return array(
array(
array(
false,
array('field_show_novalue' => true),
'No',
'Field should output the default value',
),
array(
),
array(
false,
array('field_show_novalue' => false, 'field_length' => 2),
null,
'Field should not show anything for empty value',
),
array(
),
array(
0,
array(),
'Yes',
'Field should show the set value',
),
),
);
}

View File

@ -63,22 +63,22 @@ class phpbb_profilefield_type_date_test extends phpbb_test_case
{
return array(
array(
'01-01-2009',
array('field_show_novalue' => true),
'01/01/2009',
'Field should output the correctly formatted date',
'01-01-2009',
array('field_show_novalue' => true),
'01/01/2009',
'Field should output the correctly formatted date',
),
array(
null,
array('field_show_novalue' => false),
null,
'Field should leave empty value as is',
null,
array('field_show_novalue' => false),
null,
'Field should leave empty value as is',
),
array(
'None',
array('field_show_novalue' => true),
'None',
'Field should leave invalid value as is',
'None',
array('field_show_novalue' => true),
'None',
'Field should leave invalid value as is',
),
);
}
@ -99,71 +99,71 @@ class phpbb_profilefield_type_date_test extends phpbb_test_case
{
return array(
array(
'',
array('field_required' => true),
'FIELD_REQUIRED-field',
'Field should reject value for being empty',
'',
array('field_required' => true),
'FIELD_REQUIRED-field',
'Field should reject value for being empty',
),
array(
'0125',
array('field_required' => true),
'FIELD_REQUIRED-field',
'Field should reject value for being invalid',
'0125',
array('field_required' => true),
'FIELD_REQUIRED-field',
'Field should reject value for being invalid',
),
array(
'01-01-2012',
array(),
false,
'Field should accept a valid value',
'01-01-2012',
array(),
false,
'Field should accept a valid value',
),
array(
'40-05-2009',
array(),
'FIELD_INVALID_DATE-field',
'Field should reject value for being invalid',
'40-05-2009',
array(),
'FIELD_INVALID_DATE-field',
'Field should reject value for being invalid',
),
array(
'12-30-2012',
array(),
'FIELD_INVALID_DATE-field',
'Field should reject value for being invalid',
'12-30-2012',
array(),
'FIELD_INVALID_DATE-field',
'Field should reject value for being invalid',
),
array(
'string',
array(),
false,
'Field should reject value for being invalid',
'string',
array(),
false,
'Field should reject value for being invalid',
),
array(
'string',
array('field_required' => true),
'FIELD_REQUIRED-field',
'Field should reject value for being invalid',
'string',
array('field_required' => true),
'FIELD_REQUIRED-field',
'Field should reject value for being invalid',
),
array(
100,
array(),
false,
'Field should reject value for being invalid',
100,
array(),
false,
'Field should reject value for being invalid',
),
array(
100,
array('field_required' => true),
'FIELD_REQUIRED-field',
'Field should reject value for being invalid',
100,
array('field_required' => true),
'FIELD_REQUIRED-field',
'Field should reject value for being invalid',
),
array(
null,
array('field_required' => true),
'FIELD_REQUIRED-field',
'Field should reject value for being empty',
null,
array('field_required' => true),
'FIELD_REQUIRED-field',
'Field should reject value for being empty',
),
array(
true,
array('field_required' => true),
'FIELD_REQUIRED-field',
'Field should reject value for being empty',
)
true,
array('field_required' => true),
'FIELD_REQUIRED-field',
'Field should reject value for being empty',
),
);
}

View File

@ -76,30 +76,30 @@ class phpbb_profilefield_type_dropdown_test extends phpbb_test_case
public function validate_profile_field_data()
{
return array(
array(
array(
7,
array(),
'FIELD_INVALID_VALUE-field',
'Invalid value should throw error',
),
array(
),
array(
2,
array(),
false,
'Valid value should not throw error'
),
array(
),
array(
0,
array(),
false,
'Empty value should be acceptible',
),
array(
),
array(
0,
array('field_required' => true),
'FIELD_REQUIRED-field',
'Required field should not accept empty value',
),
),
);
}
@ -119,28 +119,28 @@ class phpbb_profilefield_type_dropdown_test extends phpbb_test_case
{
return array(
array(
1,
array('field_show_novalue' => true),
'Option 1',
'Field should output the given value',
1,
array('field_show_novalue' => true),
'Option 1',
'Field should output the given value',
),
array(
4,
array('field_show_novalue' => false),
'Option 4',
'Field should output the given value',
4,
array('field_show_novalue' => false),
'Option 4',
'Field should output the given value',
),
array(
'',
array('field_show_novalue' => true),
'<No Value>',
'Field should output nothing for empty value',
'',
array('field_show_novalue' => true),
'<No Value>',
'Field should output nothing for empty value',
),
array(
'',
array('field_show_novalue' => false),
null,
'Field should simply output null for empty value',
'',
array('field_show_novalue' => false),
null,
'Field should simply output null for empty value',
),
);
}

View File

@ -55,39 +55,39 @@ class phpbb_profilefield_type_url_test extends phpbb_test_case
return array(
array(
'',
array('field_required' => true),
'FIELD_INVALID_URL-field',
'Field should reject empty field that is required',
array('field_required' => true),
'FIELD_INVALID_URL-field',
'Field should reject empty field that is required',
),
array(
'invalidURL',
array(),
'FIELD_INVALID_URL-field',
'Field should reject invalid input',
'invalidURL',
array(),
'FIELD_INVALID_URL-field',
'Field should reject invalid input',
),
array(
'http://onetwothree.example.io',
array(),
false,
'Field should accept valid URL',
'http://onetwothree.example.io',
array(),
false,
'Field should accept valid URL',
),
array(
'http://example.com/index.html?param1=test&param2=awesome',
array(),
false,
'Field should accept valid URL',
'http://example.com/index.html?param1=test&param2=awesome',
array(),
false,
'Field should accept valid URL',
),
array(
'http://example.com/index.html/test/path?document=get',
array(),
false,
'Field should accept valid URL',
'http://example.com/index.html/test/path?document=get',
array(),
false,
'Field should accept valid URL',
),
array(
'http://example.com/index.html/test/path?document[]=DocType%20test&document[]=AnotherDoc',
array(),
'FIELD_INVALID_URL-field',
'Field should reject invalid URL having multi value parameters',
'http://example.com/index.html/test/path?document[]=DocType%20test&document[]=AnotherDoc',
array(),
'FIELD_INVALID_URL-field',
'Field should reject invalid URL having multi value parameters',
),
);
}