/** * Constructor */ public function __construct() { parent::__construct(new PostCode(array('locale' => 'en-GB'))); }
public function testYouCanGetTheUnderlyingZendErrorMessages() { $object = new ZendBaseValidator(new \Zend\I18n\Validator\Alnum()); $this->assertFalse($object->isValid('')); $this->assertEquals(array('The input is an empty string'), $object->getMessages()); }
/** * Constructor */ public function __construct() { parent::__construct(new EmailAddress()); }
/** * Strip leading zeros, plus signs and spaces from telnum string * as Zend validator wants the stripped down string * * @param mixed $value * @return boolean */ protected function validate($value) { return parent::validate(str_replace(' ', '', ltrim((string) $value, '0+'))); }