Exemple #1
0
 function validateCodepostalHTTPInput($codepostal, $contentObjectAttribute)
 {
     if (!CodePostal::validate($codepostal)) {
         $contentObjectAttribute->setValidationError(ezpI18n::tr('kernel/classes/datatypes', 'The Postcode is not valid.'));
         return eZInputValidator::STATE_INVALID;
     }
     return eZInputValidator::STATE_ACCEPTED;
 }
Exemple #2
0
 public function testEmptyCodePostalAsInvalid()
 {
     $this->assertEquals(CodePostal::validate(''), false);
     $this->assertEquals(CodePostal::validate(' '), false);
 }