diff options
-rw-r--r-- | config/global.php | 6 | ||||
-rw-r--r-- | tests/PHPUnit/Integration/EmailValidatorTest.php | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/config/global.php b/config/global.php index a8de8112d7..f8a04235b7 100644 --- a/config/global.php +++ b/config/global.php @@ -66,4 +66,10 @@ return array( 'Piwik\EventDispatcher' => DI\object()->constructorParameter('observers', DI\get('observers.global')), + 'Zend_Validate_EmailAddress' => function () { + return new \Zend_Validate_EmailAddress(array( + 'hostname' => new \Zend_Validate_Hostname(array( + 'tld' => false, + )))); + }, ); diff --git a/tests/PHPUnit/Integration/EmailValidatorTest.php b/tests/PHPUnit/Integration/EmailValidatorTest.php index 89b9d2ccdf..4b2e215506 100644 --- a/tests/PHPUnit/Integration/EmailValidatorTest.php +++ b/tests/PHPUnit/Integration/EmailValidatorTest.php @@ -25,6 +25,11 @@ class EmailValidatorTest extends \PHPUnit_Framework_TestCase $this->assertTrue($this->isValid('test@example.com')); } + public function test_isValid_unknownTld() + { + $this->assertTrue($this->isValid('test@example.unknown')); + } + public function test_isValid_validUpperCaseLocalPart() { $this->assertTrue($this->isValid('TEST@example.com')); |