diff --git a/tests/Validation/ValidationValidatorTest.php b/tests/Validation/ValidationValidatorTest.php index e2fddc7d4e62..e885daf1cd8d 100755 --- a/tests/Validation/ValidationValidatorTest.php +++ b/tests/Validation/ValidationValidatorTest.php @@ -2389,6 +2389,24 @@ public function testValidateBetween() $v = new Validator($trans, ['foo' => '123'], ['foo' => 'Numeric|Between:50,100']); $this->assertFalse($v->passes()); + // inclusive on min + $v = new Validator($trans, ['foo' => '123'], ['foo' => 'Numeric|Between:123,200']); + $this->assertTrue($v->passes()); + + // inclusive on max + $v = new Validator($trans, ['foo' => '123'], ['foo' => 'Numeric|Between:0,123']); + $this->assertTrue($v->passes()); + + // can work with float + $v = new Validator($trans, ['foo' => '0.02'], ['foo' => 'Numeric|Between:0.01,0.02']); + $this->assertTrue($v->passes()); + + $v = new Validator($trans, ['foo' => '0.02'], ['foo' => 'Numeric|Between:0.01,0.03']); + $this->assertTrue($v->passes()); + + $v = new Validator($trans, ['foo' => '0.001'], ['foo' => 'Numeric|Between:0.01,0.03']); + $this->assertFalse($v->passes()); + $v = new Validator($trans, ['foo' => '3'], ['foo' => 'Numeric|Between:1,5']); $this->assertTrue($v->passes());