diff options
-rw-r--r-- | apps/files_sharing/tests/Controller/ShareAPIControllerTest.php | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php index a475474e3cf..4d944bfd58f 100644 --- a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php +++ b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php @@ -2068,7 +2068,7 @@ class ShareAPIControllerTest extends TestCase { 'file_parent' => 1, 'file_target' => 'myTarget', 'share_with' => 'user@server.com', - 'share_with_displayname' => 'user@server.com', + 'share_with_displayname' => 'foobar', 'mail_send' => 0, 'mimetype' => 'myFolderMimeType', ], $share, [], false @@ -2127,6 +2127,20 @@ class ShareAPIControllerTest extends TestCase { ->will($this->returnArgument(0)); } + $cm = $this->createMock(\OCP\Contacts\IManager::class); + $this->overwriteService(\OCP\Contacts\IManager::class, $cm); + + $cm->method('search') + ->with('user@server.com', ['CLOUD']) + ->willReturn([ + [ + 'CLOUD' => [ + 'user@server.com', + ], + 'FN' => 'foobar', + ], + ]); + try { $result = $this->invokePrivate($this->ocs, 'formatShare', [$share]); $this->assertFalse($exception); |