diff options
author | Michiel de Jong <michiel@unhosted.org> | 2023-02-20 09:50:31 +0000 |
---|---|---|
committer | Louis Chemineau <louis@chmn.me> | 2023-03-08 16:46:55 +0100 |
commit | c0e84cb512ca76cea263642918f9e045aed3c5c4 (patch) | |
tree | d1965e39eee3bc4358563a755fa43e9ac82a5ae4 /apps/files_sharing/tests | |
parent | 80e12cf72608b7c5776f02f04da98d7a5968bc73 (diff) | |
download | nextcloud-server-c0e84cb512ca76cea263642918f9e045aed3c5c4.tar.gz nextcloud-server-c0e84cb512ca76cea263642918f9e045aed3c5c4.zip |
Add SHARE_TYPE_SCIENCEMESH
Signed-off-by: Michiel de Jong <michiel@unhosted.org>
Diffstat (limited to 'apps/files_sharing/tests')
-rw-r--r-- | apps/files_sharing/tests/Controller/ShareAPIControllerTest.php | 4 | ||||
-rw-r--r-- | apps/files_sharing/tests/MountProviderTest.php | 12 |
2 files changed, 11 insertions, 5 deletions
diff --git a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php index 6405181d0dc..2a2a7d940be 100644 --- a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php +++ b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php @@ -218,10 +218,10 @@ class ShareAPIControllerTest extends TestCase { $this->expectExceptionMessage('Wrong share ID, share does not exist'); $this->shareManager - ->expects($this->exactly(6)) + ->expects($this->exactly(7)) ->method('getShareById') ->willReturnCallback(function ($id) { - if ($id === 'ocinternal:42' || $id === 'ocRoomShare:42' || $id === 'ocFederatedSharing:42' || $id === 'ocCircleShare:42' || $id === 'ocMailShare:42' || $id === 'deck:42') { + if ($id === 'ocinternal:42' || $id === 'ocRoomShare:42' || $id === 'ocFederatedSharing:42' || $id === 'ocCircleShare:42' || $id === 'ocMailShare:42' || $id === 'deck:42' || $id === 'sciencemesh:42') { throw new \OCP\Share\Exceptions\ShareNotFound(); } else { throw new \Exception(); diff --git a/apps/files_sharing/tests/MountProviderTest.php b/apps/files_sharing/tests/MountProviderTest.php index 37e7e3d9d03..f7cf5156ec5 100644 --- a/apps/files_sharing/tests/MountProviderTest.php +++ b/apps/files_sharing/tests/MountProviderTest.php @@ -163,12 +163,13 @@ class MountProviderTest extends \Test\TestCase { $this->makeMockShare(12, 103, 'user2', '/share7', 31), $this->makeMockShare(13, 103, 'user2', '/share7', 31), ]; - // tests regarding circles are made in the app itself. + // tests regarding circles and sciencemesh are made in the apps themselves. $circleShares = []; + $sciencemeshShares = []; $this->user->expects($this->any()) ->method('getUID') ->willReturn('user1'); - $this->shareManager->expects($this->exactly(5)) + $this->shareManager->expects($this->exactly(6)) ->method('getSharedWith') ->withConsecutive( ['user1', IShare::TYPE_USER], @@ -176,12 +177,14 @@ class MountProviderTest extends \Test\TestCase { ['user1', IShare::TYPE_CIRCLE, null, -1], ['user1', IShare::TYPE_ROOM, null, -1], ['user1', IShare::TYPE_DECK, null, -1], + ['user1', IShare::TYPE_SCIENCEMESH, null, -1], )->willReturnOnConsecutiveCalls( $userShares, $groupShares, $circleShares, $roomShares, $deckShares, + $sciencemeshShares ); $this->shareManager->expects($this->any()) ->method('newShare') @@ -386,7 +389,8 @@ class MountProviderTest extends \Test\TestCase { $circleShares = []; $roomShares = []; $deckShares = []; - $this->shareManager->expects($this->exactly(5)) + $sciencemeshShares = []; + $this->shareManager->expects($this->exactly(6)) ->method('getSharedWith') ->withConsecutive( ['user1', IShare::TYPE_USER], @@ -394,12 +398,14 @@ class MountProviderTest extends \Test\TestCase { ['user1', IShare::TYPE_CIRCLE, null, -1], ['user1', IShare::TYPE_ROOM, null, -1], ['user1', IShare::TYPE_DECK, null, -1], + ['user1', IShare::TYPE_SCIENCEMESH, null, -1], )->willReturnOnConsecutiveCalls( $userShares, $groupShares, $circleShares, $roomShares, $deckShares, + $sciencemeshShares ); $this->shareManager->expects($this->any()) ->method('newShare') |