Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2021-08-27 18:56:16 +0300
committerVincent Petry <vincent@nextcloud.com>2021-09-15 13:18:31 +0300
commit42239fc02ce4495726bc16c89d233c3035f6bab3 (patch)
tree5c5357d99acd8ad3b0980825aaff09936569c4ef /build
parent249582a8116ffc0366c2d07a06ae0a221675e065 (diff)
Test for transfer ownership with incoming shares
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'build')
-rw-r--r--build/integration/features/bootstrap/CommandLineContext.php16
-rw-r--r--build/integration/features/transfer-ownership.feature29
2 files changed, 43 insertions, 2 deletions
diff --git a/build/integration/features/bootstrap/CommandLineContext.php b/build/integration/features/bootstrap/CommandLineContext.php
index b435aaceca0..41756e448bf 100644
--- a/build/integration/features/bootstrap/CommandLineContext.php
+++ b/build/integration/features/bootstrap/CommandLineContext.php
@@ -97,7 +97,7 @@ class CommandLineContext implements \Behat\Behat\Context\Context {
}
/**
- * @When /^transferring ownership from "([^"]+)" to "([^"]+)"/
+ * @When /^transferring ownership from "([^"]+)" to "([^"]+)"$/
*/
public function transferringOwnership($user1, $user2) {
if ($this->runOcc(['files:transfer-ownership', $user1, $user2]) === 0) {
@@ -109,7 +109,7 @@ class CommandLineContext implements \Behat\Behat\Context\Context {
}
/**
- * @When /^transferring ownership of path "([^"]+)" from "([^"]+)" to "([^"]+)"/
+ * @When /^transferring ownership of path "([^"]+)" from "([^"]+)" to "([^"]+)"$/
*/
public function transferringOwnershipPath($path, $user1, $user2) {
$path = '--path=' . $path;
@@ -121,6 +121,18 @@ class CommandLineContext implements \Behat\Behat\Context\Context {
}
}
+ /**
+ * @When /^transferring ownership of path "([^"]+)" from "([^"]+)" to "([^"]+)" with received shares$/
+ */
+ public function transferringOwnershipPathWithIncomingShares($path, $user1, $user2) {
+ $path = '--path=' . $path;
+ if ($this->runOcc(['files:transfer-ownership', $path, $user1, $user2, '--transfer-incoming-shares=1']) === 0) {
+ $this->lastTransferPath = $this->findLastTransferFolderForUser($user1, $user2);
+ } else {
+ // failure
+ $this->lastTransferPath = null;
+ }
+ }
/**
* @When /^using received transfer folder of "([^"]+)" as dav path$/
diff --git a/build/integration/features/transfer-ownership.feature b/build/integration/features/transfer-ownership.feature
index b18453cf3ec..22e34dcf7af 100644
--- a/build/integration/features/transfer-ownership.feature
+++ b/build/integration/features/transfer-ownership.feature
@@ -533,6 +533,35 @@ Feature: transfer-ownership
And Getting info of last share
And the OCS status code should be "404"
+ Scenario: transferring ownership transfers received shares into subdir when requested
+ Given user "user0" exists
+ And user "user1" exists
+ And user "user2" exists
+ And User "user2" created a folder "/transfer-share"
+ And User "user2" created a folder "/do-not-transfer"
+ And User "user0" created a folder "/sub"
+ And folder "/transfer-share" of user "user2" is shared with user "user0" with permissions 31
+ And user "user0" accepts last share
+ And User "user0" moved folder "/transfer-share" to "/sub/transfer-share"
+ And folder "/do-not-transfer" of user "user2" is shared with user "user0" with permissions 31
+ And user "user0" accepts last share
+ When transferring ownership of path "sub" from "user0" to "user1" with received shares
+ And the command was successful
+ And As an "user1"
+ And using received transfer folder of "user1" as dav path
+ Then as "user1" the folder "/sub" exists
+ And as "user1" the folder "/do-not-transfer" does not exist
+ And as "user1" the folder "/sub/do-not-transfer" does not exist
+ And as "user1" the folder "/sub/transfer-share" exists
+ And using old dav path
+ And as "user1" the folder "/transfer-share" does not exist
+ And as "user1" the folder "/do-not-transfer" does not exist
+ And using old dav path
+ And as "user0" the folder "/sub" does not exist
+ And as "user0" the folder "/do-not-transfer" exists
+ And Getting info of last share
+ And the OCS status code should be "404"
+
Scenario: transferring ownership does not transfer external storage
Given user "user0" exists
And user "user1" exists