Exemplo n.º 1
0
 public function validate($value)
 {
     $result = parent::validate($value);
     if (!$result) {
         $this->_setLastError('invalid IPv4 address');
     }
     return $result;
 }
Exemplo n.º 2
0
 public function validate()
 {
     try {
         return parent::validate();
     } catch (ValidationException $ex) {
         throw new ValidationException($ex->getInput(), "This is not valid email address.", $ex->getCode(), $ex);
     }
 }
 public function validate()
 {
     try {
         return parent::validate();
     } catch (ValidationException $ex) {
         throw new ValidationException($ex->getInput(), "Input value has to contain only digits.", $ex->getCode(), $ex);
     }
 }
Exemplo n.º 4
0
 public function testValidateEmptyValue()
 {
     $val = new RegexValidator('/^[a-z]+$/i');
     $this->assertTrue($val->validate(''));
     $this->assertTrue($val->validate(null));
 }