summaryrefslogtreecommitdiffstats
path: root/apps/sharebymail/tests
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2017-05-04 12:41:44 +0200
committerBjoern Schiessle <bjoern@schiessle.org>2017-05-08 19:20:31 +0200
commitadb60ae965c6e79a899d46f0770100d4d5ce6a64 (patch)
treebbbb244317d961d29123882f1954936e7db32097 /apps/sharebymail/tests
parent4965f02bf4c4c5454e9ab97d4336e4bc6fa7151c (diff)
downloadnextcloud-server-adb60ae965c6e79a899d46f0770100d4d5ce6a64.tar.gz
nextcloud-server-adb60ae965c6e79a899d46f0770100d4d5ce6a64.zip
don't mention the owner of a file in case of a re-share by mail. The recipient doesn't care about the owner and probably don't even know it
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps/sharebymail/tests')
-rw-r--r--apps/sharebymail/tests/ShareByMailProviderTest.php32
1 files changed, 8 insertions, 24 deletions
diff --git a/apps/sharebymail/tests/ShareByMailProviderTest.php b/apps/sharebymail/tests/ShareByMailProviderTest.php
index 269f8e8f414..e649a9dbd0b 100644
--- a/apps/sharebymail/tests/ShareByMailProviderTest.php
+++ b/apps/sharebymail/tests/ShareByMailProviderTest.php
@@ -766,12 +766,12 @@ class ShareByMailProviderTest extends TestCase {
$provider = $this->getInstance();
$user = $this->createMock(IUser::class);
$this->userManager
- ->expects($this->exactly(2))
+ ->expects($this->once())
->method('get')
->with('OwnerUser')
->willReturn($user);
$user
- ->expects($this->exactly(2))
+ ->expects($this->once())
->method('getDisplayName')
->willReturn('Mrs. Owner User');
$message = $this->createMock(Message::class);
@@ -867,29 +867,18 @@ class ShareByMailProviderTest extends TestCase {
'file.txt',
'https://example.com/file.txt',
'OwnerUser',
- 'OwnerUser',
'john@doe.com',
]);
}
public function testSendMailNotificationWithDifferentUserAndNoUserEmail() {
$provider = $this->getInstance();
- $ownerUser = $this->createMock(IUser::class);
$initiatorUser = $this->createMock(IUser::class);
$this->userManager
- ->expects($this->at(0))
- ->method('get')
- ->with('OwnerUser')
- ->willReturn($ownerUser);
- $this->userManager
- ->expects($this->at(1))
+ ->expects($this->once())
->method('get')
->with('InitiatorUser')
->willReturn($initiatorUser);
- $ownerUser
- ->expects($this->once())
- ->method('getDisplayName')
- ->willReturn('Mrs. Owner User');
$initiatorUser
->expects($this->once())
->method('getDisplayName')
@@ -910,13 +899,13 @@ class ShareByMailProviderTest extends TestCase {
$template
->expects($this->once())
->method('addHeading')
- ->with('Mrs. Owner User shared »file.txt« with you');
+ ->with('Mr. Initiator User shared »file.txt« with you');
$template
->expects($this->once())
->method('addBodyText')
->with(
- 'Mrs. Owner User shared »file.txt« with you on behalf of InitiatorUser. Click the button below to open it.',
- 'Mrs. Owner User shared »file.txt« with you on behalf of InitiatorUser.'
+ 'Mr. Initiator User shared »file.txt« with you. Click the button below to open it.',
+ 'Mr. Initiator User shared »file.txt« with you.'
);
$template
->expects($this->once())
@@ -937,12 +926,8 @@ class ShareByMailProviderTest extends TestCase {
->expects($this->once())
->method('setFrom')
->with([
- \OCP\Util::getDefaultEmailAddress('UnitTestCloud') => 'Mrs. Owner User via UnitTestCloud'
+ \OCP\Util::getDefaultEmailAddress('UnitTestCloud') => 'Mr. Initiator User via UnitTestCloud'
]);
- $ownerUser
- ->expects($this->once())
- ->method('getEMailAddress')
- ->willReturn(null);
$message
->expects($this->never())
->method('setReplyTo');
@@ -953,7 +938,7 @@ class ShareByMailProviderTest extends TestCase {
$message
->expects($this->once())
->method('setSubject')
- ->willReturn('Mrs. Owner User shared »file.txt« with you');
+ ->willReturn('Mr. Initiator User shared »file.txt« with you');
$template
->expects($this->once())
->method('renderText')
@@ -981,7 +966,6 @@ class ShareByMailProviderTest extends TestCase {
[
'file.txt',
'https://example.com/file.txt',
- 'OwnerUser',
'InitiatorUser',
'john@doe.com',
]);