Bluz\Validator\Rule\Between::validate PHP Method

validate() public method

Check input data
public validate ( numeric $input ) : boolean
$input numeric
return boolean
    public function validate($input) : bool
    {
        return $this->less($this->minValue, $input) && $this->less($input, $this->maxValue);
    }

Usage Example

Beispiel #1
0
 /**
  * @dataProvider providerForFail
  * @expectedException \Bluz\Validator\Exception\ValidatorException
  */
 public function testValuesOutBoundsShouldRaiseException($min, $max, $inclusive, $input)
 {
     $validator = new Between($min, $max, $inclusive);
     $this->assertFalse($validator->validate($input));
     $this->assertNotEmpty($validator->__toString());
     $this->assertFalse($validator->assert($input));
 }