summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-03-24 13:46:31 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2014-03-24 13:46:31 +0100
commitfb7f3008d33cb123f8b6931f6edf8697913b355a (patch)
tree0dc278b23ca5f050a25a89256be4c56c146ae909 /tests
parentabdc823bb69600c3a4fc23e09f9de5819b57f56e (diff)
downloadnextcloud-server-fb7f3008d33cb123f8b6931f6edf8697913b355a.tar.gz
nextcloud-server-fb7f3008d33cb123f8b6931f6edf8697913b355a.zip
idn have to be converted before being used
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/mail.php30
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'),
+ );
+ }
+
+}