From 820c3b852dd478761a0ce433d0553a0f94731370 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 7 Dec 2015 12:01:02 +0100 Subject: [PATCH] Add a unit test for single user case as well --- tests/lib/share/MailNotificationsTest.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/lib/share/MailNotificationsTest.php b/tests/lib/share/MailNotificationsTest.php index 0706b97233b..8684886e798 100644 --- a/tests/lib/share/MailNotificationsTest.php +++ b/tests/lib/share/MailNotificationsTest.php @@ -125,19 +125,21 @@ class MailNotificationsTest extends \Test\TestCase { 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'], + ['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) { + public function testSendLinkShareMailWithReplyTo($to, array $expectedTo) { $message = $this->getMockBuilder('\OC\Mail\Message') ->disableOriginalConstructor()->getMock(); @@ -148,7 +150,7 @@ class MailNotificationsTest extends \Test\TestCase { $message ->expects($this->once()) ->method('setTo') - ->with(['lukas@owncloud.com', 'nickvergessen@owncloud.com']); + ->with($expectedTo); $message ->expects($this->once()) ->method('setHtmlBody'); -- 2.39.5