9
9
*/
10
10
class AdministrativeAreaValidatorTest extends BaseValidatorTestCase
11
11
{
12
- public function testMGStateInBrazil ()
12
+ public function test_mg_state_in_brazil ()
13
13
{
14
14
$ this ->assertTrue ($ this ->performValidation ([
15
15
'rules ' => ['state ' => 'administrative_area_code:country ' ],
16
16
'data ' => ['state ' => 'MG ' , 'country ' => 'BR ' ],
17
17
]));
18
18
}
19
19
20
- public function testInvalidStateInBrazil ()
20
+ public function test_invalid_state_in_brazil ()
21
21
{
22
22
$ this ->assertFalse ($ this ->performValidation ([
23
23
'data ' => ['country ' => 'BR ' , 'state ' => 'ZZ ' ],
24
24
'rules ' => ['state ' => 'administrative_area_code:country ' ],
25
25
]));
26
26
}
27
27
28
- public function testCOStateInUnitedStates ()
28
+ public function test_co_state_in_united_states ()
29
29
{
30
30
$ this ->assertTrue ($ this ->performValidation ([
31
31
'data ' => ['country ' => 'US ' , 'state ' => 'CO ' ],
32
32
'rules ' => ['state ' => 'administrative_area_code:country ' ],
33
33
]));
34
34
}
35
35
36
- public function testCountryAndStateAreLowerCase ()
36
+ public function test_country_and_state_are_lower_case ()
37
37
{
38
38
$ this ->assertTrue ($ this ->performValidation ([
39
39
'data ' => ['country ' => 'us ' , 'state ' => 'co ' ],
40
40
'rules ' => ['state ' => 'administrative_area_code:country ' ],
41
41
]));
42
42
}
43
43
44
- public function testPassesIfCountryHasNoAdminAreas ()
44
+ public function test_passes_if_country_has_no_admin_areas ()
45
45
{
46
46
$ this ->assertTrue ($ this ->performValidation ([
47
47
'data ' => ['country ' => 'GB ' , 'state ' => '' ],
48
48
'rules ' => ['state ' => 'administrative_area_code:country ' ],
49
49
]));
50
50
}
51
51
52
- public function testAdminAreaCodeArrayIsInvalid ()
52
+ public function test_admin_area_code_array_is_invalid ()
53
53
{
54
54
$ this ->assertFalse ($ this ->performValidation ([
55
55
'data ' => ['country ' => 'US ' , 'state ' => ['CO ' ]],
56
56
'rules ' => ['state ' => 'administrative_area_code:country ' ],
57
57
]));
58
58
}
59
59
60
- public function testAdminAreaNameArrayIsInvalid ()
60
+ public function test_admin_area_name_array_is_invalid ()
61
61
{
62
62
$ this ->assertFalse ($ this ->performValidation ([
63
63
'data ' => ['country ' => 'US ' , 'state ' => ['Colorado ' ]],
64
64
'rules ' => ['state ' => 'administrative_area_name:country ' ],
65
65
]));
66
66
}
67
67
68
- public function testGeneralAdminAreaArrayIsInvalid ()
68
+ public function test_general_admin_area_array_is_invalid ()
69
69
{
70
70
$ this ->assertFalse ($ this ->performValidation ([
71
71
'data ' => ['country ' => 'US ' , 'state ' => ['CO ' ]],
72
72
'rules ' => ['state ' => 'administrative_area:country ' ],
73
73
]));
74
74
}
75
75
76
- public function testUSStateByName ()
76
+ public function test_us_state_by_name ()
77
77
{
78
78
// Valid state in US
79
79
$ this ->assertTrue ($ this ->performValidation ([
@@ -87,7 +87,7 @@ public function testUSStateByName()
87
87
]));
88
88
}
89
89
90
- public function testStateUsingCountryName ()
90
+ public function test_state_using_country_name ()
91
91
{
92
92
// Valid US state
93
93
$ this ->assertTrue ($ this ->performValidation ([
@@ -101,7 +101,7 @@ public function testStateUsingCountryName()
101
101
]));
102
102
}
103
103
104
- public function testGeneralAdministrativeAreaValidation ()
104
+ public function test_general_administrative_area_validation ()
105
105
{
106
106
// Valid US state
107
107
$ this ->assertTrue ($ this ->performValidation ([
@@ -125,7 +125,7 @@ public function testGeneralAdministrativeAreaValidation()
125
125
]));
126
126
}
127
127
128
- public function testUsesDefaultFieldNames ()
128
+ public function test_uses_default_field_names ()
129
129
{
130
130
$ this ->assertTrue ($ this ->performValidation ([
131
131
'data ' => ['country ' => 'US ' , 'state ' => 'CO ' ],
@@ -148,7 +148,7 @@ public function testUsesDefaultFieldNames()
148
148
]));
149
149
}
150
150
151
- public function testAllowsEmptyAdministrativeAreasInCountriesWhereItIsOptional ()
151
+ public function test_allows_empty_administrative_areas_in_countries_where_it_is_optional ()
152
152
{
153
153
// Empty county should be allowed in Ireland
154
154
$ this ->assertTrue ($ this ->performValidation ([
@@ -169,7 +169,7 @@ public function testAllowsEmptyAdministrativeAreasInCountriesWhereItIsOptional()
169
169
]));
170
170
}
171
171
172
- public function testAllowsAnyAdminAreaInCountriesWeDontHaveDataFor ()
172
+ public function test_allows_any_admin_area_in_countries_we_dont_have_data_for ()
173
173
{
174
174
// As of right now, addressing doesn't have an admin area list for South Africa
175
175
$ this ->assertTrue ($ this ->performValidation ([
0 commit comments