summaryrefslogtreecommitdiffstats
path: root/build/integration/features
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2019-04-15 12:22:34 +0200
committerJulius Härtl <jus@bitgrid.net>2019-04-16 15:03:52 +0200
commit771ad85f859ccaeb815f0ff5256dfde36ce589c6 (patch)
treef48fc22d64d297ab990a7b5af06e9771855f0a7b /build/integration/features
parent4e88cd3aae0b1c8e662197dd10e2e65ffe8cf489 (diff)
downloadnextcloud-server-771ad85f859ccaeb815f0ff5256dfde36ce589c6.tar.gz
nextcloud-server-771ad85f859ccaeb815f0ff5256dfde36ce589c6.zip
Add integration tests for updating folder shares
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'build/integration/features')
-rw-r--r--build/integration/features/bootstrap/Sharing.php17
-rw-r--r--build/integration/features/sharing-v1-part3.feature32
2 files changed, 49 insertions, 0 deletions
diff --git a/build/integration/features/bootstrap/Sharing.php b/build/integration/features/bootstrap/Sharing.php
index 9a3c00af489..8fcbbb2fcc1 100644
--- a/build/integration/features/bootstrap/Sharing.php
+++ b/build/integration/features/bootstrap/Sharing.php
@@ -42,6 +42,9 @@ trait Sharing {
/** @var SimpleXMLElement */
private $lastShareData = null;
+ /** @var SimpleXMLElement[] */
+ private $storedShareData = [];
+
/** @var int */
private $savedShareId = null;
@@ -86,6 +89,20 @@ trait Sharing {
}
/**
+ * @When /^save the last share data as "([^"]*)"$/
+ */
+ public function saveLastShareData($name) {
+ $this->storedShareData[$name] = $this->lastShareData;
+ }
+
+ /**
+ * @When /^restore the last share data from "([^"]*)"$/
+ */
+ public function restoreLastShareData($name) {
+ $this->lastShareData = $this->storedShareData[$name];
+ }
+
+ /**
* @When /^creating a share with$/
* @param \Behat\Gherkin\Node\TableNode|null $body
*/
diff --git a/build/integration/features/sharing-v1-part3.feature b/build/integration/features/sharing-v1-part3.feature
index 6ab7cfdf9a0..1b3fe8245c4 100644
--- a/build/integration/features/sharing-v1-part3.feature
+++ b/build/integration/features/sharing-v1-part3.feature
@@ -393,3 +393,35 @@ Feature: sharing
When User "user1" moved file "/textfile0.txt" to "/shared/shared_file.txt"
Then as "user1" the file "/shared/shared_file.txt" exists
And as "user0" the file "/shared/shared_file.txt" exists
+
+ Scenario: Link shares inside of group shares keep their original data when the root share is updated
+ Given As an "admin"
+ And user "user0" exists
+ And user "user1" exists
+ And group "group1" exists
+ And user "user1" belongs to group "group1"
+ And As an "user0"
+ And user "user0" created a folder "/share"
+ And folder "/share" of user "user0" is shared with group "group1"
+ And user "user0" created a folder "/share/subfolder"
+ And As an "user1"
+ And save the last share data as "original"
+ And as "user1" creating a share with
+ | path | /share/subfolder |
+ | shareType | 3 |
+ | permissions | 31 |
+ And save the last share data as "link"
+ And As an "user0"
+ And restore the last share data from "original"
+ When Updating last share with
+ | permissions | 23 |
+ | expireDate | +3 days |
+ And restore the last share data from "link"
+ And Getting info of last share
+ And Share fields of last share match with
+ | id | A_NUMBER |
+ | item_source | A_NUMBER |
+ | share_type | 3 |
+ | permissions | 23 |
+ | file_target | /subfolder |
+ | expireDate | |