summaryrefslogtreecommitdiffstats
path: root/tests/lib/mail/mailer.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/mail/mailer.php')
-rw-r--r--tests/lib/mail/mailer.php23
1 files changed, 22 insertions, 1 deletions
diff --git a/tests/lib/mail/mailer.php b/tests/lib/mail/mailer.php
index bd410dd3383..2cb4c5cfde3 100644
--- a/tests/lib/mail/mailer.php
+++ b/tests/lib/mail/mailer.php
@@ -1,6 +1,6 @@
<?php
/**
- * Copyright (c) 2014 Lukas Reschke <lukas@owncloud.com>
+ * Copyright (c) 2014-2015 Lukas Reschke <lukas@owncloud.com>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
@@ -115,4 +115,25 @@ class MailerTest extends TestCase {
$this->mailer->send($message);
}
+ /**
+ * @return array
+ */
+ public function mailAddressProvider() {
+ return [
+ ['lukas@owncloud.com', true],
+ ['lukas@localhost', true],
+ ['lukas@192.168.1.1', true],
+ ['lukas@éxämplè.com', true],
+ ['asdf', false],
+ ['lukas@owncloud.org@owncloud.com', false],
+ ];
+ }
+
+ /**
+ * @dataProvider mailAddressProvider
+ */
+ public function testValidateMailAddress($email, $expected) {
+ $this->assertSame($expected, $this->mailer->validateMailAddress($email));
+ }
+
}