@@ -106,7 +106,7 @@ public function getValidGroupedTimezones(): iterable
106
106
/**
107
107
* @dataProvider getInvalidTimezones
108
108
*/
109
- public function testInvalidTimezonesWithoutZone (string $ timezone, string $ zoneMessage , string $ countryCodeMessage )
109
+ public function testInvalidTimezonesWithoutZone (string $ timezone )
110
110
{
111
111
$ constraint = new Timezone (array (
112
112
'message ' => 'myMessage ' ,
@@ -115,25 +115,24 @@ public function testInvalidTimezonesWithoutZone(string $timezone, string $zoneMe
115
115
$ this ->validator ->validate ($ timezone , $ constraint );
116
116
117
117
$ this ->buildViolation ('myMessage ' )
118
- ->setParameter ('{{ zone_message }} ' , $ zoneMessage )
119
- ->setParameter ('{{ country_code_message }} ' , $ countryCodeMessage )
118
+ ->setParameter ('{{ value }} ' , '" ' .$ timezone .'" ' )
120
119
->setCode (Timezone::NO_SUCH_TIMEZONE_ERROR )
121
120
->assertRaised ();
122
121
}
123
122
124
123
public function getInvalidTimezones (): iterable
125
124
{
126
125
return array (
127
- array ('Buenos_Aires/Argentina/America ' , '' , '' ),
128
- array ('Mayotte/Indian ' , '' , '' ),
129
- array ('foobar ' , '' , '' ),
126
+ array ('Buenos_Aires/Argentina/America ' ),
127
+ array ('Mayotte/Indian ' ),
128
+ array ('foobar ' ),
130
129
);
131
130
}
132
131
133
132
/**
134
133
* @dataProvider getInvalidGroupedTimezones
135
134
*/
136
- public function testInvalidGroupedTimezones (string $ timezone , int $ what, string $ zoneMessage , string $ countryCodeMessage )
135
+ public function testInvalidGroupedTimezones (string $ timezone , int $ what )
137
136
{
138
137
$ constraint = new Timezone (array (
139
138
'zone ' => $ what ,
@@ -143,20 +142,19 @@ public function testInvalidGroupedTimezones(string $timezone, int $what, string
143
142
$ this ->validator ->validate ($ timezone , $ constraint );
144
143
145
144
$ this ->buildViolation ('myMessage ' )
146
- ->setParameter ('{{ zone_message }} ' , $ zoneMessage )
147
- ->setParameter ('{{ country_code_message }} ' , $ countryCodeMessage )
145
+ ->setParameter ('{{ value }} ' , '" ' .$ timezone .'" ' )
148
146
->setCode (Timezone::NO_SUCH_TIMEZONE_IN_ZONE_ERROR )
149
147
->assertRaised ();
150
148
}
151
149
152
150
public function getInvalidGroupedTimezones (): iterable
153
151
{
154
152
return array (
155
- array ('Antarctica/McMurdo ' , \DateTimeZone::AMERICA , ' at "AMERICA" zone ' , '' ),
156
- array ('America/Barbados ' , \DateTimeZone::ANTARCTICA , ' at "ANTARCTICA" zone ' , '' ),
157
- array ('Europe/Kiev ' , \DateTimeZone::ARCTIC , ' at "ARCTIC" zone ' , '' ),
158
- array ('Asia/Ho_Chi_Minh ' , \DateTimeZone::INDIAN , ' at "INDIAN" zone ' , '' ),
159
- array ('Asia/Ho_Chi_Minh ' , \DateTimeZone::INDIAN | \DateTimeZone::ANTARCTICA , ' at zone with identifier 260 ' , '' ),
153
+ array ('Antarctica/McMurdo ' , \DateTimeZone::AMERICA ),
154
+ array ('America/Barbados ' , \DateTimeZone::ANTARCTICA ),
155
+ array ('Europe/Kiev ' , \DateTimeZone::ARCTIC ),
156
+ array ('Asia/Ho_Chi_Minh ' , \DateTimeZone::INDIAN ),
157
+ array ('Asia/Ho_Chi_Minh ' , \DateTimeZone::INDIAN | \DateTimeZone::ANTARCTICA ),
160
158
);
161
159
}
162
160
@@ -197,7 +195,7 @@ public function getValidGroupedTimezonesByCountry(): iterable
197
195
/**
198
196
* @dataProvider getInvalidGroupedTimezonesByCountry
199
197
*/
200
- public function testInvalidGroupedTimezonesByCountry (string $ timezone , int $ what , string $ country, string $ zoneMessage , string $ countryCodeMessage )
198
+ public function testInvalidGroupedTimezonesByCountry (string $ timezone , int $ what , string $ country )
201
199
{
202
200
$ constraint = new Timezone (array (
203
201
'message ' => 'myMessage ' ,
@@ -208,17 +206,16 @@ public function testInvalidGroupedTimezonesByCountry(string $timezone, int $what
208
206
$ this ->validator ->validate ($ timezone , $ constraint );
209
207
210
208
$ this ->buildViolation ('myMessage ' )
211
- ->setParameter ('{{ zone_message }} ' , $ zoneMessage )
212
- ->setParameter ('{{ country_code_message }} ' , $ countryCodeMessage )
209
+ ->setParameter ('{{ value }} ' , '" ' .$ timezone .'" ' )
213
210
->setCode (Timezone::NO_SUCH_TIMEZONE_IN_COUNTRY_ERROR )
214
211
->assertRaised ();
215
212
}
216
213
217
214
public function getInvalidGroupedTimezonesByCountry (): iterable
218
215
{
219
216
return array (
220
- array ('America/Argentina/Cordoba ' , \DateTimeZone::PER_COUNTRY , 'FR ' , '' , ' for ISO 3166-1 country code "FR" ' ),
221
- array ('America/Barbados ' , \DateTimeZone::PER_COUNTRY , 'PT ' , '' , ' for ISO 3166-1 country code "PT" ' ),
217
+ array ('America/Argentina/Cordoba ' , \DateTimeZone::PER_COUNTRY , 'FR ' ),
218
+ array ('America/Barbados ' , \DateTimeZone::PER_COUNTRY , 'PT ' ),
222
219
);
223
220
}
224
221
@@ -248,8 +245,7 @@ public function testDeprecatedTimezonesAreInvaildWithoutBC(string $timezone)
248
245
$ this ->validator ->validate ($ timezone , $ constraint );
249
246
250
247
$ this ->buildViolation ('myMessage ' )
251
- ->setParameter ('{{ zone_message }} ' , '' )
252
- ->setParameter ('{{ country_code_message }} ' , '' )
248
+ ->setParameter ('{{ value }} ' , '" ' .$ timezone .'" ' )
253
249
->setCode (Timezone::NO_SUCH_TIMEZONE_ERROR )
254
250
->assertRaised ();
255
251
}
0 commit comments