diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-03-25 12:38:32 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-03-25 12:38:32 +0100 |
commit | 531c9564b3ec848f1869f57bccb41c6c529749b5 (patch) | |
tree | d3248e9a48766eba94c6fa0bdbd702800abf579d /tests | |
parent | b92dad992f86caf3d30f5a10856c417c2a0a28bc (diff) | |
parent | 3eb5898f7b8f8b836b15dcb9c9a9213d7edbda96 (diff) | |
download | nextcloud-server-531c9564b3ec848f1869f57bccb41c6c529749b5.tar.gz nextcloud-server-531c9564b3ec848f1869f57bccb41c6c529749b5.zip |
Merge pull request #7861 from owncloud/idn-domains-support-on-emails-master
idn have to be converted before being used
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/mail.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/lib/mail.php b/tests/lib/mail.php new file mode 100644 index 00000000000..a88a9d797ae --- /dev/null +++ b/tests/lib/mail.php @@ -0,0 +1,30 @@ +<?php +/** + * Copyright (c) 2014 Thomas Müller <deepdiver@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +class Test_Mail extends PHPUnit_Framework_TestCase { + + /** + * @dataProvider buildAsciiEmailProvider + * @param $expected + * @param $address + */ + public function testBuildAsciiEmail($expected, $address) { + $actual = \OC_Mail::buildAsciiEmail($address); + $this->assertEquals($expected, $actual); + } + + function buildAsciiEmailProvider() { + return array( + array('info@example.com', 'info@example.com'), + array('info@xn--cjr6vy5ejyai80u.com', 'info@國際化域名.com'), + array('info@xn--mller-kva.de', 'info@müller.de'), + array('info@xn--mller-kva.xn--mller-kva.de', 'info@müller.müller.de'), + ); + } + +} |