validate() публичный Метод

Check input data
public validate ( mixed $input ) : boolean
$input mixed
Результат 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));
 }