summaryrefslogtreecommitdiffstats
path: root/tests/lib/mail
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-02-19 18:55:27 +0100
committerLukas Reschke <lukas@owncloud.com>2015-03-16 12:47:05 +0100
commitf92f3a1a6ecbce06fbe24204ef12b2eeeb0f0d15 (patch)
treedca224d1136cae6d5a971cd110a0591ce0d8d1ef /tests/lib/mail
parent283476a2f7c200912352eb4db097f540e3993e75 (diff)
downloadnextcloud-server-f92f3a1a6ecbce06fbe24204ef12b2eeeb0f0d15.tar.gz
nextcloud-server-f92f3a1a6ecbce06fbe24204ef12b2eeeb0f0d15.zip
Incorporate review changes
Diffstat (limited to 'tests/lib/mail')
-rw-r--r--tests/lib/mail/mailer.php23
-rw-r--r--tests/lib/mail/util.php39
2 files changed, 22 insertions, 40 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));
+ }
+
}
diff --git a/tests/lib/mail/util.php b/tests/lib/mail/util.php
deleted file mode 100644
index 04d9d5df256..00000000000
--- a/tests/lib/mail/util.php
+++ /dev/null
@@ -1,39 +0,0 @@
-<?php
-/**
- * Copyright (c) 2014 Lukas Reschke <lukas@owncloud.com>
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file.
- */
-
-namespace Test;
-use OCP\Mail\Util;
-
-/**
- * Class Util
- *
- * @package OC\Mail
- */
-class UtilTest extends TestCase {
-
- /**
- * @return array
- */
- public function mailAddressProvider() {
- return array(
- array('lukas@owncloud.com', true),
- array('lukas@localhost', true),
- array('lukas@192.168.1.1', true),
- array('lukas@éxämplè.com', true),
- array('asdf', false),
- array('lukas@owncloud.org@owncloud.com', false)
- );
- }
-
- /**
- * @dataProvider mailAddressProvider
- */
- public function testValidateMailAddress($email, $expected) {
- $this->assertSame($expected, Util::validateMailAddress($email));
- }
-}