summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2019-12-02 18:16:33 -0100
committerRoeland Jago Douma <roeland@famdouma.nl>2019-12-03 08:13:22 +0100
commitf2c7ca45840d20a8b6c40937958f4e5a8953d0dd (patch)
treecf13a79fa5512cda9d480d901549e7b9113acce7 /apps/files_sharing/tests
parent3a86b9925693fbcbaf0adb64a8d85500f055ef38 (diff)
downloadnextcloud-server-f2c7ca45840d20a8b6c40937958f4e5a8953d0dd.tar.gz
nextcloud-server-f2c7ca45840d20a8b6c40937958f4e5a8953d0dd.zip
fixing tests + avoid duplicate in getFormattedShares()
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'apps/files_sharing/tests')
-rw-r--r--apps/files_sharing/tests/Controller/ShareAPIControllerTest.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php
index ae7fc54599c..90238d64274 100644
--- a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php
+++ b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php
@@ -106,6 +106,9 @@ class ShareAPIControllerTest extends TestCase {
->expects($this->any())
->method('shareApiEnabled')
->willReturn(true);
+ $this->shareManager
+ ->expects($this->any())
+ ->method('shareProviderExists')->willReturn(true);
$this->groupManager = $this->createMock(IGroupManager::class);
$this->userManager = $this->createMock(IUserManager::class);
$this->request = $this->createMock(IRequest::class);
@@ -170,10 +173,10 @@ class ShareAPIControllerTest extends TestCase {
$this->expectExceptionMessage('Wrong share ID, share doesn\'t exist');
$this->shareManager
- ->expects($this->exactly(3))
+ ->expects($this->exactly(5))
->method('getShareById')
->will($this->returnCallback(function($id) {
- if ($id === 'ocinternal:42' || $id === 'ocRoomShare:42' || $id === 'ocFederatedSharing:42') {
+ if ($id === 'ocinternal:42' || $id === 'ocRoomShare:42' || $id === 'ocFederatedSharing:42' || $id === 'ocCircleShare:42' || $id === 'ocMailShare:42') {
throw new \OCP\Share\Exceptions\ShareNotFound();
} else {
throw new \Exception();
@@ -1008,9 +1011,7 @@ class ShareAPIControllerTest extends TestCase {
[
],
[
- $file1UserShareOwnerExpected,
- $file1UserShareOwnerExpected,
- $file1UserShareOwnerExpected,
+ $file1UserShareOwnerExpected
]
],
[