validate() public method

Check input data
public validate ( mixed $input ) : boolean
$input mixed
return boolean
示例#1
0
 /**
  * Used small set for testing
  */
 public function testValidEmailWithDomainCheck()
 {
     $validator = new Email(true);
     $this->assertTrue($validator->validate('*****@*****.**'));
     $this->assertFalse($validator->validate('a@a.a'));
 }
示例#2
0
 /**
  * @dataProvider providerForFail
  * @expectedException \Bluz\Validator\Exception\ValidatorException
  */
 public function testInvalidEmailsShouldFailValidation($invalidEmail)
 {
     $validator = new Email();
     $this->assertFalse($validator->validate($invalidEmail));
     $this->assertFalse($validator->assert($invalidEmail));
 }