diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-12-07 15:17:19 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-12-07 15:17:19 +0100 |
commit | a9e5faf7d001842a0e14c98a27516a1806df98dd (patch) | |
tree | 8bb5ca08a52ee4377499da68e0c5bc2e02143ad4 /tests | |
parent | e44b164f406b52530d81e755c9e1b959e0f1ef27 (diff) | |
parent | 820c3b852dd478761a0ce433d0553a0f94731370 (diff) | |
download | nextcloud-server-a9e5faf7d001842a0e14c98a27516a1806df98dd.tar.gz nextcloud-server-a9e5faf7d001842a0e14c98a27516a1806df98dd.zip |
Merge pull request #20981 from owncloud/issue-19848-multiple-emails-for-sharelink
Allow sending a share email to multiple users
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/share/MailNotificationsTest.php | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/tests/lib/share/MailNotificationsTest.php b/tests/lib/share/MailNotificationsTest.php index 2124a8bf13b..8684886e798 100644 --- a/tests/lib/share/MailNotificationsTest.php +++ b/tests/lib/share/MailNotificationsTest.php @@ -123,7 +123,23 @@ 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', ['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(); @@ -134,7 +150,7 @@ class MailNotificationsTest extends \Test\TestCase { $message ->expects($this->once()) ->method('setTo') - ->with(['lukas@owncloud.com']); + ->with($expectedTo); $message ->expects($this->once()) ->method('setHtmlBody'); @@ -167,7 +183,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() { |