@@ -143,16 +143,16 @@ public function testInvalidValuesCombinedMax($value, $formattedValue)
143
143
$ constraint = new Range ([
144
144
'min ' => 10 ,
145
145
'max ' => 20 ,
146
- 'minMessage ' => 'myMinMessage ' ,
147
- 'maxMessage ' => 'myMaxMessage ' ,
146
+ 'notInRangeMessage ' => 'myNotInRangeMessage ' ,
148
147
]);
149
148
150
149
$ this ->validator ->validate ($ value , $ constraint );
151
150
152
- $ this ->buildViolation ('myMaxMessage ' )
151
+ $ this ->buildViolation ('myNotInRangeMessage ' )
153
152
->setParameter ('{{ value }} ' , $ formattedValue )
154
- ->setParameter ('{{ limit }} ' , 20 )
155
- ->setCode (Range::TOO_HIGH_ERROR )
153
+ ->setParameter ('{{ min }} ' , 10 )
154
+ ->setParameter ('{{ max }} ' , 20 )
155
+ ->setCode (Range::NOT_IN_RANGE_ERROR )
156
156
->assertRaised ();
157
157
}
158
158
@@ -164,16 +164,16 @@ public function testInvalidValuesCombinedMin($value, $formattedValue)
164
164
$ constraint = new Range ([
165
165
'min ' => 10 ,
166
166
'max ' => 20 ,
167
- 'minMessage ' => 'myMinMessage ' ,
168
- 'maxMessage ' => 'myMaxMessage ' ,
167
+ 'notInRangeMessage ' => 'myNotInRangeMessage ' ,
169
168
]);
170
169
171
170
$ this ->validator ->validate ($ value , $ constraint );
172
171
173
- $ this ->buildViolation ('myMinMessage ' )
172
+ $ this ->buildViolation ('myNotInRangeMessage ' )
174
173
->setParameter ('{{ value }} ' , $ formattedValue )
175
- ->setParameter ('{{ limit }} ' , 10 )
176
- ->setCode (Range::TOO_LOW_ERROR )
174
+ ->setParameter ('{{ min }} ' , 10 )
175
+ ->setParameter ('{{ max }} ' , 20 )
176
+ ->setCode (Range::NOT_IN_RANGE_ERROR )
177
177
->assertRaised ();
178
178
}
179
179
@@ -327,16 +327,16 @@ public function testInvalidDatesCombinedMax($value, $dateTimeAsString)
327
327
$ constraint = new Range ([
328
328
'min ' => 'March 10, 2014 ' ,
329
329
'max ' => 'March 20, 2014 ' ,
330
- 'minMessage ' => 'myMinMessage ' ,
331
- 'maxMessage ' => 'myMaxMessage ' ,
330
+ 'notInRangeMessage ' => 'myNotInRangeMessage ' ,
332
331
]);
333
332
334
333
$ this ->validator ->validate ($ value , $ constraint );
335
334
336
- $ this ->buildViolation ('myMaxMessage ' )
335
+ $ this ->buildViolation ('myNotInRangeMessage ' )
337
336
->setParameter ('{{ value }} ' , $ dateTimeAsString )
338
- ->setParameter ('{{ limit }} ' , 'Mar 20, 2014, 12:00 AM ' )
339
- ->setCode (Range::TOO_HIGH_ERROR )
337
+ ->setParameter ('{{ min }} ' , 'Mar 10, 2014, 12:00 AM ' )
338
+ ->setParameter ('{{ max }} ' , 'Mar 20, 2014, 12:00 AM ' )
339
+ ->setCode (Range::NOT_IN_RANGE_ERROR )
340
340
->assertRaised ();
341
341
}
342
342
@@ -352,16 +352,16 @@ public function testInvalidDatesCombinedMin($value, $dateTimeAsString)
352
352
$ constraint = new Range ([
353
353
'min ' => 'March 10, 2014 ' ,
354
354
'max ' => 'March 20, 2014 ' ,
355
- 'minMessage ' => 'myMinMessage ' ,
356
- 'maxMessage ' => 'myMaxMessage ' ,
355
+ 'notInRangeMessage ' => 'myNotInRangeMessage ' ,
357
356
]);
358
357
359
358
$ this ->validator ->validate ($ value , $ constraint );
360
359
361
- $ this ->buildViolation ('myMinMessage ' )
360
+ $ this ->buildViolation ('myNotInRangeMessage ' )
362
361
->setParameter ('{{ value }} ' , $ dateTimeAsString )
363
- ->setParameter ('{{ limit }} ' , 'Mar 10, 2014, 12:00 AM ' )
364
- ->setCode (Range::TOO_LOW_ERROR )
362
+ ->setParameter ('{{ min }} ' , 'Mar 10, 2014, 12:00 AM ' )
363
+ ->setParameter ('{{ max }} ' , 'Mar 20, 2014, 12:00 AM ' )
364
+ ->setCode (Range::NOT_IN_RANGE_ERROR )
365
365
->assertRaised ();
366
366
}
367
367
@@ -499,18 +499,18 @@ public function testInvalidValuesCombinedMaxPropertyPath($value, $formattedValue
499
499
$ constraint = new Range ([
500
500
'minPropertyPath ' => 'min ' ,
501
501
'maxPropertyPath ' => 'max ' ,
502
- 'minMessage ' => 'myMinMessage ' ,
503
- 'maxMessage ' => 'myMaxMessage ' ,
502
+ 'notInRangeMessage ' => 'myNotInRangeMessage ' ,
504
503
]);
505
504
506
505
$ this ->validator ->validate ($ value , $ constraint );
507
506
508
- $ this ->buildViolation ('myMaxMessage ' )
507
+ $ this ->buildViolation ('myNotInRangeMessage ' )
509
508
->setParameter ('{{ value }} ' , $ formattedValue )
510
- ->setParameter ('{{ limit }} ' , 20 )
509
+ ->setParameter ('{{ min }} ' , 10 )
510
+ ->setParameter ('{{ max }} ' , 20 )
511
511
->setParameter ('{{ max_limit_path }} ' , 'max ' )
512
512
->setParameter ('{{ min_limit_path }} ' , 'min ' )
513
- ->setCode (Range::TOO_HIGH_ERROR )
513
+ ->setCode (Range::NOT_IN_RANGE_ERROR )
514
514
->assertRaised ();
515
515
}
516
516
@@ -524,18 +524,18 @@ public function testInvalidValuesCombinedMinPropertyPath($value, $formattedValue
524
524
$ constraint = new Range ([
525
525
'minPropertyPath ' => 'min ' ,
526
526
'maxPropertyPath ' => 'max ' ,
527
- 'minMessage ' => 'myMinMessage ' ,
528
- 'maxMessage ' => 'myMaxMessage ' ,
527
+ 'notInRangeMessage ' => 'myNotInRangeMessage ' ,
529
528
]);
530
529
531
530
$ this ->validator ->validate ($ value , $ constraint );
532
531
533
- $ this ->buildViolation ('myMinMessage ' )
532
+ $ this ->buildViolation ('myNotInRangeMessage ' )
534
533
->setParameter ('{{ value }} ' , $ formattedValue )
535
- ->setParameter ('{{ limit }} ' , 10 )
534
+ ->setParameter ('{{ min }} ' , 10 )
535
+ ->setParameter ('{{ max }} ' , 20 )
536
536
->setParameter ('{{ max_limit_path }} ' , 'max ' )
537
537
->setParameter ('{{ min_limit_path }} ' , 'min ' )
538
- ->setCode (Range::TOO_LOW_ERROR )
538
+ ->setCode (Range::NOT_IN_RANGE_ERROR )
539
539
->assertRaised ();
540
540
}
541
541
@@ -685,18 +685,18 @@ public function testInvalidDatesCombinedMaxPropertyPath($value, $dateTimeAsStrin
685
685
$ constraint = new Range ([
686
686
'minPropertyPath ' => 'min ' ,
687
687
'maxPropertyPath ' => 'max ' ,
688
- 'minMessage ' => 'myMinMessage ' ,
689
- 'maxMessage ' => 'myMaxMessage ' ,
688
+ 'notInRangeMessage ' => 'myNotInRangeMessage ' ,
690
689
]);
691
690
692
691
$ this ->validator ->validate ($ value , $ constraint );
693
692
694
- $ this ->buildViolation ('myMaxMessage ' )
693
+ $ this ->buildViolation ('myNotInRangeMessage ' )
695
694
->setParameter ('{{ value }} ' , $ dateTimeAsString )
696
- ->setParameter ('{{ limit }} ' , 'Mar 20, 2014, 12:00 AM ' )
695
+ ->setParameter ('{{ min }} ' , 'Mar 10, 2014, 12:00 AM ' )
696
+ ->setParameter ('{{ max }} ' , 'Mar 20, 2014, 12:00 AM ' )
697
697
->setParameter ('{{ max_limit_path }} ' , 'max ' )
698
698
->setParameter ('{{ min_limit_path }} ' , 'min ' )
699
- ->setCode (Range::TOO_HIGH_ERROR )
699
+ ->setCode (Range::NOT_IN_RANGE_ERROR )
700
700
->assertRaised ();
701
701
}
702
702
@@ -714,18 +714,18 @@ public function testInvalidDatesCombinedMinPropertyPath($value, $dateTimeAsStrin
714
714
$ constraint = new Range ([
715
715
'minPropertyPath ' => 'min ' ,
716
716
'maxPropertyPath ' => 'max ' ,
717
- 'minMessage ' => 'myMinMessage ' ,
718
- 'maxMessage ' => 'myMaxMessage ' ,
717
+ 'notInRangeMessage ' => 'myNotInRangeMessage ' ,
719
718
]);
720
719
721
720
$ this ->validator ->validate ($ value , $ constraint );
722
721
723
- $ this ->buildViolation ('myMinMessage ' )
722
+ $ this ->buildViolation ('myNotInRangeMessage ' )
724
723
->setParameter ('{{ value }} ' , $ dateTimeAsString )
725
- ->setParameter ('{{ limit }} ' , 'Mar 10, 2014, 12:00 AM ' )
724
+ ->setParameter ('{{ min }} ' , 'Mar 10, 2014, 12:00 AM ' )
725
+ ->setParameter ('{{ max }} ' , 'Mar 20, 2014, 12:00 AM ' )
726
726
->setParameter ('{{ max_limit_path }} ' , 'max ' )
727
727
->setParameter ('{{ min_limit_path }} ' , 'min ' )
728
- ->setCode (Range::TOO_LOW_ERROR )
728
+ ->setCode (Range::NOT_IN_RANGE_ERROR )
729
729
->assertRaised ();
730
730
}
731
731
}
0 commit comments