Skip to content
Permalink
Browse files

Add intl email test.

  • Loading branch information...
dereuromark committed Sep 16, 2014
1 parent d34ff71 commit 4d1a65ede21000df089e6b9609e3621f0ad58b46
Showing with 4 additions and 1 deletion.
  1. +2 −1 lib/Cake/Network/Email/CakeEmail.php
  2. +2 −0 lib/Cake/Test/Case/Network/Email/CakeEmailTest.php
@@ -597,7 +597,8 @@ protected function _setEmail($varName, $email, $name) {
protected function _validateEmail($email) {
if ($this->_emailPattern === null && filter_var($email, FILTER_VALIDATE_EMAIL)) {
return;
} elseif (preg_match($this->_emailPattern, $email)) {
}
if (preg_match($this->_emailPattern, $email)) {
return;
}
throw new SocketException(__d('cake_dev', 'Invalid email: "%s"', $email));
@@ -267,6 +267,7 @@ public function testTo() {
$this->CakeEmail->addTo('jrbasso@cakephp.org');
$this->CakeEmail->addTo('mark_story@cakephp.org', 'Mark Story');
$this->CakeEmail->addTo('foobar@ætdcadsl.dk');
$result = $this->CakeEmail->addTo(array('phpnut@cakephp.org' => 'PhpNut', 'jose_zap@cakephp.org'));
$expected = array(
'root@localhost' => 'root',
@@ -276,6 +277,7 @@ public function testTo() {
'root@cakephp.org' => 'root@cakephp.org',
'jrbasso@cakephp.org' => 'jrbasso@cakephp.org',
'mark_story@cakephp.org' => 'Mark Story',
'foobar@ætdcadsl.dk' => 'foobar@ætdcadsl.dk',
'phpnut@cakephp.org' => 'PhpNut',
'jose_zap@cakephp.org' => 'jose_zap@cakephp.org'
);

0 comments on commit 4d1a65e

Please sign in to comment.
You can’t perform that action at this time.