summaryrefslogtreecommitdiffstats
path: root/tests/lib/Share
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-04-11 17:32:48 -0500
committerMorris Jobke <hey@morrisjobke.de>2017-04-11 17:32:48 -0500
commit8fa5141aaa346fc21198ad59c315eb99a8b8e48a (patch)
treeb88273d191e11f9541609f08935c2956c85346aa /tests/lib/Share
parent6bd1c50dc32ccc208723ef08af72b8bfe99b58bb (diff)
downloadnextcloud-server-8fa5141aaa346fc21198ad59c315eb99a8b8e48a.tar.gz
nextcloud-server-8fa5141aaa346fc21198ad59c315eb99a8b8e48a.zip
Removes unused code for link share emails
* now handled by sharebymail app * see https://github.com/nextcloud/server/pull/657 Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'tests/lib/Share')
-rw-r--r--tests/lib/Share/MailNotificationsTest.php124
1 files changed, 0 insertions, 124 deletions
diff --git a/tests/lib/Share/MailNotificationsTest.php b/tests/lib/Share/MailNotificationsTest.php
index 6fae8eb72fd..2759ee04946 100644
--- a/tests/lib/Share/MailNotificationsTest.php
+++ b/tests/lib/Share/MailNotificationsTest.php
@@ -84,130 +84,6 @@ class MailNotificationsTest extends \Test\TestCase {
}
- public function testSendLinkShareMailWithoutReplyTo() {
- $message = $this->getMockBuilder('\OC\Mail\Message')
- ->disableOriginalConstructor()->getMock();
-
- $message
- ->expects($this->once())
- ->method('setSubject')
- ->with('TestUser shared »MyFile« with you');
- $message
- ->expects($this->once())
- ->method('setTo')
- ->with(['lukas@owncloud.com']);
- $message
- ->expects($this->once())
- ->method('setHtmlBody');
- $message
- ->expects($this->once())
- ->method('setPlainBody');
- $message
- ->expects($this->once())
- ->method('setFrom')
- ->with([\OCP\Util::getDefaultEmailAddress('sharing-noreply') => 'TestUser via UnitTestCloud']);
-
- $this->mailer
- ->expects($this->once())
- ->method('createMessage')
- ->will($this->returnValue($message));
- $this->mailer
- ->expects($this->once())
- ->method('send')
- ->with($message)
- ->will($this->returnValue([]));
-
- $mailNotifications = new MailNotifications(
- $this->user,
- $this->l10n,
- $this->mailer,
- $this->logger,
- $this->defaults,
- $this->urlGenerator
- );
-
- $this->assertSame([], $mailNotifications->sendLinkShareMail('lukas@owncloud.com', 'MyFile', 'https://owncloud.com/file/?foo=bar', 3600));
- }
-
- public function dataSendLinkShareMailWithReplyTo() {
- return [
- ['lukas@owncloud.com', ['lukas@owncloud.com']],
- ['lukas@owncloud.com nickvergessen@owncloud.com', ['lukas@owncloud.com', 'nickvergessen@owncloud.com']],
- ['lukas@owncloud.com,nickvergessen@owncloud.com', ['lukas@owncloud.com', 'nickvergessen@owncloud.com']],
- ['lukas@owncloud.com, nickvergessen@owncloud.com', ['lukas@owncloud.com', 'nickvergessen@owncloud.com']],
- ['lukas@owncloud.com;nickvergessen@owncloud.com', ['lukas@owncloud.com', 'nickvergessen@owncloud.com']],
- ['lukas@owncloud.com; nickvergessen@owncloud.com', ['lukas@owncloud.com', 'nickvergessen@owncloud.com']],
- ];
- }
-
- /**
- * @dataProvider dataSendLinkShareMailWithReplyTo
- * @param string $to
- * @param array $expectedTo
- */
- public function testSendLinkShareMailWithReplyTo($to, array $expectedTo) {
- $message = $this->getMockBuilder('\OC\Mail\Message')
- ->disableOriginalConstructor()->getMock();
-
- $message
- ->expects($this->once())
- ->method('setSubject')
- ->with('TestUser shared »MyFile« with you');
- $message
- ->expects($this->once())
- ->method('setTo')
- ->with($expectedTo);
- $message
- ->expects($this->once())
- ->method('setHtmlBody');
- $message
- ->expects($this->once())
- ->method('setPlainBody');
- $message
- ->expects($this->once())
- ->method('setFrom')
- ->with([\OCP\Util::getDefaultEmailAddress('sharing-noreply') => 'TestUser via UnitTestCloud']);
- $message
- ->expects($this->once())
- ->method('setReplyTo')
- ->with(['sharer@owncloud.com']);
-
- $this->mailer
- ->expects($this->once())
- ->method('createMessage')
- ->will($this->returnValue($message));
- $this->mailer
- ->expects($this->once())
- ->method('send')
- ->with($message)
- ->will($this->returnValue([]));
-
- $mailNotifications = new MailNotifications(
- $this->user,
- $this->l10n,
- $this->mailer,
- $this->logger,
- $this->defaults,
- $this->urlGenerator
- );
- $this->assertSame([], $mailNotifications->sendLinkShareMail($to, 'MyFile', 'https://owncloud.com/file/?foo=bar', 3600));
- }
-
- public function testSendLinkShareMailException() {
- $this->setupMailerMock('TestUser shared »MyFile« with you', ['lukas@owncloud.com']);
-
- $mailNotifications = new MailNotifications(
- $this->user,
- $this->l10n,
- $this->mailer,
- $this->logger,
- $this->defaults,
- $this->urlGenerator
- );
-
- $this->assertSame(['lukas@owncloud.com'], $mailNotifications->sendLinkShareMail('lukas@owncloud.com', 'MyFile', 'https://owncloud.com/file/?foo=bar', 3600));
- }
-
/**
* @param string $subject
*/