@@ -52,20 +52,20 @@ public function getTenToTwenty()
52
52
public function getLessThanTen ()
53
53
{
54
54
return array (
55
- array (9.99999 ),
56
- array ('9.99999 ' ),
57
- array (5 ),
58
- array (1.0 ),
55
+ array (9.99999 , ' 9.99999 ' ),
56
+ array ('9.99999 ' , ' "9.99999" ' ),
57
+ array (5 , ' 5 ' ),
58
+ array (1.0 , ' 1.0 ' ),
59
59
);
60
60
}
61
61
62
62
public function getMoreThanTwenty ()
63
63
{
64
64
return array (
65
- array (20.000001 ),
66
- array ('20.000001 ' ),
67
- array (21 ),
68
- array (30.0 ),
65
+ array (20.000001 , ' 20.000001 ' ),
66
+ array ('20.000001 ' , ' "20.000001" ' ),
67
+ array (21 , ' 21 ' ),
68
+ array (30.0 , ' 30.0 ' ),
69
69
);
70
70
}
71
71
@@ -105,7 +105,7 @@ public function testValidValuesMinMax($value)
105
105
/**
106
106
* @dataProvider getLessThanTen
107
107
*/
108
- public function testInvalidValuesMin ($ value )
108
+ public function testInvalidValuesMin ($ value, $ formattedValue )
109
109
{
110
110
$ constraint = new Range (array (
111
111
'min ' => 10 ,
@@ -115,7 +115,7 @@ public function testInvalidValuesMin($value)
115
115
$ this ->validator ->validate ($ value , $ constraint );
116
116
117
117
$ this ->buildViolation ('myMessage ' )
118
- ->setParameter ('{{ value }} ' , $ value )
118
+ ->setParameter ('{{ value }} ' , $ formattedValue )
119
119
->setParameter ('{{ limit }} ' , 10 )
120
120
->setCode (Range::BELOW_RANGE_ERROR )
121
121
->assertRaised ();
@@ -124,7 +124,7 @@ public function testInvalidValuesMin($value)
124
124
/**
125
125
* @dataProvider getMoreThanTwenty
126
126
*/
127
- public function testInvalidValuesMax ($ value )
127
+ public function testInvalidValuesMax ($ value, $ formattedValue )
128
128
{
129
129
$ constraint = new Range (array (
130
130
'max ' => 20 ,
@@ -134,7 +134,7 @@ public function testInvalidValuesMax($value)
134
134
$ this ->validator ->validate ($ value , $ constraint );
135
135
136
136
$ this ->buildViolation ('myMessage ' )
137
- ->setParameter ('{{ value }} ' , $ value )
137
+ ->setParameter ('{{ value }} ' , $ formattedValue )
138
138
->setParameter ('{{ limit }} ' , 20 )
139
139
->setCode (Range::BEYOND_RANGE_ERROR )
140
140
->assertRaised ();
@@ -143,7 +143,7 @@ public function testInvalidValuesMax($value)
143
143
/**
144
144
* @dataProvider getMoreThanTwenty
145
145
*/
146
- public function testInvalidValuesCombinedMax ($ value )
146
+ public function testInvalidValuesCombinedMax ($ value, $ formattedValue )
147
147
{
148
148
$ constraint = new Range (array (
149
149
'min ' => 10 ,
@@ -155,7 +155,7 @@ public function testInvalidValuesCombinedMax($value)
155
155
$ this ->validator ->validate ($ value , $ constraint );
156
156
157
157
$ this ->buildViolation ('myMaxMessage ' )
158
- ->setParameter ('{{ value }} ' , $ value )
158
+ ->setParameter ('{{ value }} ' , $ formattedValue )
159
159
->setParameter ('{{ limit }} ' , 20 )
160
160
->setCode (Range::BEYOND_RANGE_ERROR )
161
161
->assertRaised ();
@@ -164,7 +164,7 @@ public function testInvalidValuesCombinedMax($value)
164
164
/**
165
165
* @dataProvider getLessThanTen
166
166
*/
167
- public function testInvalidValuesCombinedMin ($ value )
167
+ public function testInvalidValuesCombinedMin ($ value, $ formattedValue )
168
168
{
169
169
$ constraint = new Range (array (
170
170
'min ' => 10 ,
@@ -176,7 +176,7 @@ public function testInvalidValuesCombinedMin($value)
176
176
$ this ->validator ->validate ($ value , $ constraint );
177
177
178
178
$ this ->buildViolation ('myMinMessage ' )
179
- ->setParameter ('{{ value }} ' , $ value )
179
+ ->setParameter ('{{ value }} ' , $ formattedValue )
180
180
->setParameter ('{{ limit }} ' , 10 )
181
181
->setCode (Range::BELOW_RANGE_ERROR )
182
182
->assertRaised ();
@@ -212,13 +212,13 @@ public function getSoonerThanTenthMarch2014()
212
212
$ this ->setDefaultTimezone ('UTC ' );
213
213
214
214
$ tests = array (
215
- array (new \DateTime ('March 20, 2013 ' )),
216
- array (new \DateTime ('March 9, 2014 ' )),
215
+ array (new \DateTime ('March 20, 2013 ' ), ' Mar 20, 2013, 12:00 AM ' ),
216
+ array (new \DateTime ('March 9, 2014 ' ), ' Mar 9, 2014, 12:00 AM ' ),
217
217
);
218
218
219
219
if (version_compare (PHP_VERSION , '5.5.0-dev ' , '>= ' )) {
220
- $ tests [] = array (new \DateTimeImmutable ('March 20, 2013 ' ));
221
- $ tests [] = array (new \DateTimeImmutable ('March 9, 2014 ' ));
220
+ $ tests [] = array (new \DateTimeImmutable ('March 20, 2013 ' ), ' Mar 20, 2013, 12:00 AM ' );
221
+ $ tests [] = array (new \DateTimeImmutable ('March 9, 2014 ' ), ' Mar 9, 2014, 12:00 AM ' );
222
222
}
223
223
224
224
$ this ->restoreDefaultTimezone ();
@@ -233,13 +233,13 @@ public function getLaterThanTwentiethMarch2014()
233
233
$ this ->setDefaultTimezone ('UTC ' );
234
234
235
235
$ tests = array (
236
- array (new \DateTime ('March 21, 2014 ' )),
237
- array (new \DateTime ('March 9, 2015 ' )),
236
+ array (new \DateTime ('March 21, 2014 ' ), ' Mar 21, 2014, 12:00 AM ' ),
237
+ array (new \DateTime ('March 9, 2015 ' ), ' Mar 9, 2015, 12:00 AM ' ),
238
238
);
239
239
240
240
if (version_compare (PHP_VERSION , '5.5.0-dev ' , '>= ' )) {
241
- $ tests [] = array (new \DateTimeImmutable ('March 21, 2014 ' ));
242
- $ tests [] = array (new \DateTimeImmutable ('March 9, 2015 ' ));
241
+ $ tests [] = array (new \DateTimeImmutable ('March 21, 2014 ' ), ' Mar 21, 2014, 12:00 AM ' );
242
+ $ tests [] = array (new \DateTimeImmutable ('March 9, 2015 ' ), ' Mar 9, 2015, 12:00 AM ' );
243
243
}
244
244
245
245
$ this ->restoreDefaultTimezone ();
@@ -283,7 +283,7 @@ public function testValidDatesMinMax($value)
283
283
/**
284
284
* @dataProvider getSoonerThanTenthMarch2014
285
285
*/
286
- public function testInvalidDatesMin ($ value )
286
+ public function testInvalidDatesMin ($ value, $ dateTimeAsString )
287
287
{
288
288
// Conversion of dates to string differs between ICU versions
289
289
// Make sure we have the correct version loaded
@@ -297,7 +297,7 @@ public function testInvalidDatesMin($value)
297
297
$ this ->validator ->validate ($ value , $ constraint );
298
298
299
299
$ this ->buildViolation ('myMessage ' )
300
- ->setParameter ('{{ value }} ' , $ value )
300
+ ->setParameter ('{{ value }} ' , $ dateTimeAsString )
301
301
->setParameter ('{{ limit }} ' , 'Mar 10, 2014, 12:00 AM ' )
302
302
->setCode (Range::BELOW_RANGE_ERROR )
303
303
->assertRaised ();
@@ -306,7 +306,7 @@ public function testInvalidDatesMin($value)
306
306
/**
307
307
* @dataProvider getLaterThanTwentiethMarch2014
308
308
*/
309
- public function testInvalidDatesMax ($ value )
309
+ public function testInvalidDatesMax ($ value, $ dateTimeAsString )
310
310
{
311
311
// Conversion of dates to string differs between ICU versions
312
312
// Make sure we have the correct version loaded
@@ -320,7 +320,7 @@ public function testInvalidDatesMax($value)
320
320
$ this ->validator ->validate ($ value , $ constraint );
321
321
322
322
$ this ->buildViolation ('myMessage ' )
323
- ->setParameter ('{{ value }} ' , $ value )
323
+ ->setParameter ('{{ value }} ' , $ dateTimeAsString )
324
324
->setParameter ('{{ limit }} ' , 'Mar 20, 2014, 12:00 AM ' )
325
325
->setCode (Range::BEYOND_RANGE_ERROR )
326
326
->assertRaised ();
@@ -329,7 +329,7 @@ public function testInvalidDatesMax($value)
329
329
/**
330
330
* @dataProvider getLaterThanTwentiethMarch2014
331
331
*/
332
- public function testInvalidDatesCombinedMax ($ value )
332
+ public function testInvalidDatesCombinedMax ($ value, $ dateTimeAsString )
333
333
{
334
334
// Conversion of dates to string differs between ICU versions
335
335
// Make sure we have the correct version loaded
@@ -345,7 +345,7 @@ public function testInvalidDatesCombinedMax($value)
345
345
$ this ->validator ->validate ($ value , $ constraint );
346
346
347
347
$ this ->buildViolation ('myMaxMessage ' )
348
- ->setParameter ('{{ value }} ' , $ value )
348
+ ->setParameter ('{{ value }} ' , $ dateTimeAsString )
349
349
->setParameter ('{{ limit }} ' , 'Mar 20, 2014, 12:00 AM ' )
350
350
->setCode (Range::BEYOND_RANGE_ERROR )
351
351
->assertRaised ();
@@ -354,7 +354,7 @@ public function testInvalidDatesCombinedMax($value)
354
354
/**
355
355
* @dataProvider getSoonerThanTenthMarch2014
356
356
*/
357
- public function testInvalidDatesCombinedMin ($ value )
357
+ public function testInvalidDatesCombinedMin ($ value, $ dateTimeAsString )
358
358
{
359
359
// Conversion of dates to string differs between ICU versions
360
360
// Make sure we have the correct version loaded
@@ -370,7 +370,7 @@ public function testInvalidDatesCombinedMin($value)
370
370
$ this ->validator ->validate ($ value , $ constraint );
371
371
372
372
$ this ->buildViolation ('myMinMessage ' )
373
- ->setParameter ('{{ value }} ' , $ value )
373
+ ->setParameter ('{{ value }} ' , $ dateTimeAsString )
374
374
->setParameter ('{{ limit }} ' , 'Mar 10, 2014, 12:00 AM ' )
375
375
->setCode (Range::BELOW_RANGE_ERROR )
376
376
->assertRaised ();
0 commit comments