Example #1
0
 public function setValue($newValue)
 {
     if (!empty($newValue)) {
         $validator = new EmailValidator($newValue);
         if (!$validator->isValid()) {
             throw new \InvalidArgumentException(sprintf('Not an email: "%s"', $newValue));
         }
     }
     return parent::setValue($newValue);
 }
Example #2
0
 public function testValid()
 {
     $validator = new Email('*****@*****.**');
     $this->assertTrue($validator->isValid());
 }