summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests/External
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2021-07-20 16:42:19 +0200
committerVincent Petry <vincent@nextcloud.com>2021-07-27 12:20:03 +0200
commite67e90afce36edb18cebbc5f5799e427b891e114 (patch)
treeda36576051a89553df234166d8c7a31053faac20 /apps/files_sharing/tests/External
parent3deffc31615fa118565084ff2901affaf7d0a403 (diff)
downloadnextcloud-server-e67e90afce36edb18cebbc5f5799e427b891e114.tar.gz
nextcloud-server-e67e90afce36edb18cebbc5f5799e427b891e114.zip
Fix remote group share decline+accept code path
When declining a remote group share through the dialog that appears when notifications are off, the mount point is now correctly saved when re-accepting. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'apps/files_sharing/tests/External')
-rw-r--r--apps/files_sharing/tests/External/ManagerTest.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/apps/files_sharing/tests/External/ManagerTest.php b/apps/files_sharing/tests/External/ManagerTest.php
index 39e25dd75a6..86b05f6d2ad 100644
--- a/apps/files_sharing/tests/External/ManagerTest.php
+++ b/apps/files_sharing/tests/External/ManagerTest.php
@@ -548,6 +548,42 @@ class ManagerTest extends TestCase {
$this->assertFalse($this->manager->removeShare($this->uid . '/files/' . $shareData['name']));
}
+ public function testDeclineThenAcceptGroupShareAgainThroughGroupShare() {
+ [$shareData, $groupShare] = $this->createTestGroupShare();
+ // decline, this creates a declined sub-share
+ $this->assertTrue($this->manager->declineShare($groupShare['id']));
+ $this->verifyDeclinedGroupShare($shareData);
+
+ // this will return sub-entries
+ $openShares = $this->manager->getOpenShares();
+
+ // accept through sub-share
+ $this->assertTrue($this->manager->acceptShare($groupShare['id']));
+ $this->verifyAcceptedGroupShare($shareData, '/SharedFolder');
+
+ // accept a second time
+ $this->assertTrue($this->manager->acceptShare($groupShare['id']));
+ $this->verifyAcceptedGroupShare($shareData, '/SharedFolder');
+ }
+
+ public function testDeclineThenAcceptGroupShareAgainThroughSubShare() {
+ [$shareData, $groupShare] = $this->createTestGroupShare();
+ // decline, this creates a declined sub-share
+ $this->assertTrue($this->manager->declineShare($groupShare['id']));
+ $this->verifyDeclinedGroupShare($shareData);
+
+ // this will return sub-entries
+ $openShares = $this->manager->getOpenShares();
+
+ // accept through sub-share
+ $this->assertTrue($this->manager->acceptShare($openShares[0]['id']));
+ $this->verifyAcceptedGroupShare($shareData);
+
+ // accept a second time
+ $this->assertTrue($this->manager->acceptShare($openShares[0]['id']));
+ $this->verifyAcceptedGroupShare($shareData);
+ }
+
/**
* @param array $expected
* @param array $actual