diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2017-04-19 17:08:52 +0200 |
---|---|---|
committer | Bjoern Schiessle <bjoern@schiessle.org> | 2017-04-20 16:33:27 +0200 |
commit | aa54d31bd2161f74ccccd375fab46bdf63c5207e (patch) | |
tree | 62b69095f7b77fa5a21fff7863876d2fdd4dd4fa /apps/sharebymail | |
parent | 972b4c04e2ea3bf96533c111853a57177231c638 (diff) | |
download | nextcloud-server-aa54d31bd2161f74ccccd375fab46bdf63c5207e.tar.gz nextcloud-server-aa54d31bd2161f74ccccd375fab46bdf63c5207e.zip |
fix unit tests
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps/sharebymail')
-rw-r--r-- | apps/sharebymail/lib/ShareByMailProvider.php | 6 | ||||
-rw-r--r-- | apps/sharebymail/tests/ShareByMailProviderTest.php | 8 |
2 files changed, 4 insertions, 10 deletions
diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php index f31a774b1d1..459b1ffe7c1 100644 --- a/apps/sharebymail/lib/ShareByMailProvider.php +++ b/apps/sharebymail/lib/ShareByMailProvider.php @@ -381,7 +381,6 @@ class ShareByMailProvider implements IShareProvider { $initiatorUser = $this->userManager->get($initiator); $ownerDisplayName = ($ownerUser instanceof IUser) ? $ownerUser->getDisplayName() : $owner; $initiatorDisplayName = ($initiatorUser instanceof IUser) ? $initiatorUser->getDisplayName() : $initiator; - $initiatorEmailAddress = ($initiatorUser instanceof IUser) ? $initiatorUser->getEMailAddress() : null; if ($owner === $initiator) { $subject = (string)$this->l->t('%s shared »%s« with you', array($ownerDisplayName, $filename)); } else { @@ -408,11 +407,6 @@ class ShareByMailProvider implements IShareProvider { $link ); - $emailTemplate->addFooter(); - if ($initiatorEmailAddress !== null) { - $message->setFrom([$initiatorEmailAddress => $initiatorDisplayName]); - } - $message->setTo([$shareWith]); // The "From" contains the sharers name diff --git a/apps/sharebymail/tests/ShareByMailProviderTest.php b/apps/sharebymail/tests/ShareByMailProviderTest.php index a3e5da82bf2..269f8e8f414 100644 --- a/apps/sharebymail/tests/ShareByMailProviderTest.php +++ b/apps/sharebymail/tests/ShareByMailProviderTest.php @@ -187,11 +187,11 @@ class ShareByMailProviderTest extends TestCase { $node = $this->getMockBuilder(File::class)->getMock(); $node->expects($this->any())->method('getName')->willReturn('filename'); - $instance = $this->getInstance(['getSharedWith', 'createMailShare', 'getRawShare', 'createShareObject', 'createActivity', 'sendPassword']); + $instance = $this->getInstance(['getSharedWith', 'createMailShare', 'getRawShare', 'createShareObject', 'createShareActivity', 'sendPassword']); $instance->expects($this->once())->method('getSharedWith')->willReturn([]); $instance->expects($this->once())->method('createMailShare')->with($share)->willReturn(42); - $instance->expects($this->once())->method('createActivity')->with($share); + $instance->expects($this->once())->method('createShareActivity')->with($share); $instance->expects($this->once())->method('getRawShare')->with(42)->willReturn('rawShare'); $instance->expects($this->once())->method('createShareObject')->with('rawShare')->willReturn('shareObject'); $instance->expects($this->any())->method('sendPassword')->willReturn(true); @@ -661,7 +661,7 @@ class ShareByMailProviderTest extends TestCase { $userManager = \OC::$server->getUserManager(); $rootFolder = \OC::$server->getRootFolder(); - $provider = $this->getInstance(['sendMailNotification', 'createActivity']); + $provider = $this->getInstance(['sendMailNotification', 'createShareActivity']); $u1 = $userManager->createUser('testFed', md5(time())); $u2 = $userManager->createUser('testFed2', md5(time())); @@ -703,7 +703,7 @@ class ShareByMailProviderTest extends TestCase { $userManager = \OC::$server->getUserManager(); $rootFolder = \OC::$server->getRootFolder(); - $provider = $this->getInstance(['sendMailNotification', 'createActivity']); + $provider = $this->getInstance(['sendMailNotification', 'createShareActivity']); $u1 = $userManager->createUser('testFed', md5(time())); $u2 = $userManager->createUser('testFed2', md5(time())); |