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

validate() public method

Check for negative number
public validate ( string $input ) : boolean
$input string
return boolean
    public function validate($input) : bool
    {
        return $input < 0;
    }

Usage Example

Beispiel #1
0
 /**
  * @dataProvider providerForFail
  * @expectedException \Bluz\Validator\Exception\ValidatorException
  */
 public function testNotNegativeNumbersShouldThrowNegativeException($input)
 {
     $this->assertFalse($this->validator->validate($input));
     $this->assertFalse($this->validator->assert($input));
 }
Negative