Beispiel #1
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct(new PostCode(array('locale' => 'en-GB')));
 }
Beispiel #2
0
 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());
 }
Beispiel #3
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct(new EmailAddress());
 }
Beispiel #4
0
 /**
  * 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+')));
 }