/**
  * Tests that it is possible to set email regex configuration to a CakeEmail object
  *
  * @return void
  */
 public function testConfigEmailPattern()
 {
     $regex = '/.+@.+\\..+/i';
     $email = new CakeEmail(array('emailPattern' => $regex));
     $this->assertSame($regex, $email->emailPattern());
 }
Beispiel #2
0
 /**
  * Tests that it is possible to unset the email pattern and make use of filter_var() instead.
  *
  * @return void
  *
  * @expectedException SocketException
  * @expectedExceptionMessage Invalid email: "*****@*****.**"
  */
 public function testUnsetEmailPattern()
 {
     $email = new CakeEmail();
     $this->assertSame(CakeEmail::EMAIL_PATTERN, $email->emailPattern());
     $email->emailPattern(null);
     $this->assertNull($email->emailPattern());
     $email->to('*****@*****.**');
     $email->to('*****@*****.**');
 }