From 96be3a4a7d6995ccbae53d0d4597f1cb9e4fba2f Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 7 Dec 2015 10:49:34 +0100 Subject: Allow sending a share email to multiple users --- tests/lib/share/MailNotificationsTest.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/lib/share/MailNotificationsTest.php b/tests/lib/share/MailNotificationsTest.php index c74fe406db1..27a728cbab7 100644 --- a/tests/lib/share/MailNotificationsTest.php +++ b/tests/lib/share/MailNotificationsTest.php @@ -119,7 +119,21 @@ class MailNotificationsTest extends \Test\TestCase { $this->assertSame([], $mailNotifications->sendLinkShareMail('lukas@owncloud.com', 'MyFile', 'https://owncloud.com/file/?foo=bar', 3600)); } - public function testSendLinkShareMailWithReplyTo() { + public function dataSendLinkShareMailWithReplyTo() { + return [ + ['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 + */ + public function testSendLinkShareMailWithReplyTo($to) { $message = $this->getMockBuilder('\OC\Mail\Message') ->disableOriginalConstructor()->getMock(); @@ -130,7 +144,7 @@ class MailNotificationsTest extends \Test\TestCase { $message ->expects($this->once()) ->method('setTo') - ->with(['lukas@owncloud.com']); + ->with(['lukas@owncloud.com', 'nickvergessen@owncloud.com']); $message ->expects($this->once()) ->method('setHtmlBody'); @@ -175,7 +189,7 @@ class MailNotificationsTest extends \Test\TestCase { $this->logger, $this->defaults ); - $this->assertSame([], $mailNotifications->sendLinkShareMail('lukas@owncloud.com', 'MyFile', 'https://owncloud.com/file/?foo=bar', 3600)); + $this->assertSame([], $mailNotifications->sendLinkShareMail($to, 'MyFile', 'https://owncloud.com/file/?foo=bar', 3600)); } public function testSendLinkShareMailException() { -- cgit v1.2.3