@@ -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
@@ -527,18 +527,18 @@ public function testInvalidValuesCombinedMaxPropertyPath($value, $formattedValue
527
527
$ constraint = new Range ([
528
528
'minPropertyPath ' => 'min ' ,
529
529
'maxPropertyPath ' => 'max ' ,
530
- 'minMessage ' => 'myMinMessage ' ,
531
- 'maxMessage ' => 'myMaxMessage ' ,
530
+ 'notInRangeMessage ' => 'myNotInRangeMessage ' ,
532
531
]);
533
532
534
533
$ this ->validator ->validate ($ value , $ constraint );
535
534
536
- $ this ->buildViolation ('myMaxMessage ' )
535
+ $ this ->buildViolation ('myNotInRangeMessage ' )
537
536
->setParameter ('{{ value }} ' , $ formattedValue )
538
- ->setParameter ('{{ limit }} ' , 20 )
537
+ ->setParameter ('{{ min }} ' , 10 )
538
+ ->setParameter ('{{ max }} ' , 20 )
539
539
->setParameter ('{{ max_limit_path }} ' , 'max ' )
540
540
->setParameter ('{{ min_limit_path }} ' , 'min ' )
541
- ->setCode (Range::TOO_HIGH_ERROR )
541
+ ->setCode (Range::NOT_IN_RANGE_ERROR )
542
542
->assertRaised ();
543
543
}
544
544
@@ -552,18 +552,18 @@ public function testInvalidValuesCombinedMinPropertyPath($value, $formattedValue
552
552
$ constraint = new Range ([
553
553
'minPropertyPath ' => 'min ' ,
554
554
'maxPropertyPath ' => 'max ' ,
555
- 'minMessage ' => 'myMinMessage ' ,
556
- 'maxMessage ' => 'myMaxMessage ' ,
555
+ 'notInRangeMessage ' => 'myNotInRangeMessage ' ,
557
556
]);
558
557
559
558
$ this ->validator ->validate ($ value , $ constraint );
560
559
561
- $ this ->buildViolation ('myMinMessage ' )
560
+ $ this ->buildViolation ('myNotInRangeMessage ' )
562
561
->setParameter ('{{ value }} ' , $ formattedValue )
563
- ->setParameter ('{{ limit }} ' , 10 )
562
+ ->setParameter ('{{ min }} ' , 10 )
563
+ ->setParameter ('{{ max }} ' , 20 )
564
564
->setParameter ('{{ max_limit_path }} ' , 'max ' )
565
565
->setParameter ('{{ min_limit_path }} ' , 'min ' )
566
- ->setCode (Range::TOO_LOW_ERROR )
566
+ ->setCode (Range::NOT_IN_RANGE_ERROR )
567
567
->assertRaised ();
568
568
}
569
569
@@ -713,18 +713,18 @@ public function testInvalidDatesCombinedMaxPropertyPath($value, $dateTimeAsStrin
713
713
$ constraint = new Range ([
714
714
'minPropertyPath ' => 'min ' ,
715
715
'maxPropertyPath ' => 'max ' ,
716
- 'minMessage ' => 'myMinMessage ' ,
717
- 'maxMessage ' => 'myMaxMessage ' ,
716
+ 'notInRangeMessage ' => 'myNotInRangeMessage ' ,
718
717
]);
719
718
720
719
$ this ->validator ->validate ($ value , $ constraint );
721
720
722
- $ this ->buildViolation ('myMaxMessage ' )
721
+ $ this ->buildViolation ('myNotInRangeMessage ' )
723
722
->setParameter ('{{ value }} ' , $ dateTimeAsString )
724
- ->setParameter ('{{ limit }} ' , 'Mar 20, 2014, 12:00 AM ' )
723
+ ->setParameter ('{{ min }} ' , 'Mar 10, 2014, 12:00 AM ' )
724
+ ->setParameter ('{{ max }} ' , 'Mar 20, 2014, 12:00 AM ' )
725
725
->setParameter ('{{ max_limit_path }} ' , 'max ' )
726
726
->setParameter ('{{ min_limit_path }} ' , 'min ' )
727
- ->setCode (Range::TOO_HIGH_ERROR )
727
+ ->setCode (Range::NOT_IN_RANGE_ERROR )
728
728
->assertRaised ();
729
729
}
730
730
@@ -742,18 +742,18 @@ public function testInvalidDatesCombinedMinPropertyPath($value, $dateTimeAsStrin
742
742
$ constraint = new Range ([
743
743
'minPropertyPath ' => 'min ' ,
744
744
'maxPropertyPath ' => 'max ' ,
745
- 'minMessage ' => 'myMinMessage ' ,
746
- 'maxMessage ' => 'myMaxMessage ' ,
745
+ 'notInRangeMessage ' => 'myNotInRangeMessage ' ,
747
746
]);
748
747
749
748
$ this ->validator ->validate ($ value , $ constraint );
750
749
751
- $ this ->buildViolation ('myMinMessage ' )
750
+ $ this ->buildViolation ('myNotInRangeMessage ' )
752
751
->setParameter ('{{ value }} ' , $ dateTimeAsString )
753
- ->setParameter ('{{ limit }} ' , 'Mar 10, 2014, 12:00 AM ' )
752
+ ->setParameter ('{{ min }} ' , 'Mar 10, 2014, 12:00 AM ' )
753
+ ->setParameter ('{{ max }} ' , 'Mar 20, 2014, 12:00 AM ' )
754
754
->setParameter ('{{ max_limit_path }} ' , 'max ' )
755
755
->setParameter ('{{ min_limit_path }} ' , 'min ' )
756
- ->setCode (Range::TOO_LOW_ERROR )
756
+ ->setCode (Range::NOT_IN_RANGE_ERROR )
757
757
->assertRaised ();
758
758
}
759
759
}
0 commit comments