@@ -2389,6 +2389,24 @@ public function testValidateBetween()
2389
2389
$ v = new Validator ($ trans , ['foo ' => '123 ' ], ['foo ' => 'Numeric|Between:50,100 ' ]);
2390
2390
$ this ->assertFalse ($ v ->passes ());
2391
2391
2392
+ // inclusive on min
2393
+ $ v = new Validator ($ trans , ['foo ' => '123 ' ], ['foo ' => 'Numeric|Between:123,200 ' ]);
2394
+ $ this ->assertTrue ($ v ->passes ());
2395
+
2396
+ // inclusive on max
2397
+ $ v = new Validator ($ trans , ['foo ' => '123 ' ], ['foo ' => 'Numeric|Between:0,123 ' ]);
2398
+ $ this ->assertTrue ($ v ->passes ());
2399
+
2400
+ // can work with float
2401
+ $ v = new Validator ($ trans , ['foo ' => '0.02 ' ], ['foo ' => 'Numeric|Between:0.01,0.02 ' ]);
2402
+ $ this ->assertTrue ($ v ->passes ());
2403
+
2404
+ $ v = new Validator ($ trans , ['foo ' => '0.02 ' ], ['foo ' => 'Numeric|Between:0.01,0.03 ' ]);
2405
+ $ this ->assertTrue ($ v ->passes ());
2406
+
2407
+ $ v = new Validator ($ trans , ['foo ' => '0.001 ' ], ['foo ' => 'Numeric|Between:0.01,0.03 ' ]);
2408
+ $ this ->assertFalse ($ v ->passes ());
2409
+
2392
2410
$ v = new Validator ($ trans , ['foo ' => '3 ' ], ['foo ' => 'Numeric|Between:1,5 ' ]);
2393
2411
$ this ->assertTrue ($ v ->passes ());
2394
2412
0 commit comments