summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2018-11-06 11:42:11 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2018-11-13 11:25:31 +0100
commit6eb178369148ace572eaec6637d9cc3375772b91 (patch)
tree444f2c61c11baacdaf7c037d11e34c4e8e822ed3
parentc52dd9f658f253ba039bc4a44eb69080ff5e2f28 (diff)
Add integration tests for getting shares of a deleted file
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
-rw-r--r--tests/integration/features/bootstrap/SharingContext.php16
-rw-r--r--tests/integration/features/sharing/get.feature143
2 files changed, 159 insertions, 0 deletions
diff --git a/tests/integration/features/bootstrap/SharingContext.php b/tests/integration/features/bootstrap/SharingContext.php
index f29aaa23a..a3d37663e 100644
--- a/tests/integration/features/bootstrap/SharingContext.php
+++ b/tests/integration/features/bootstrap/SharingContext.php
@@ -104,6 +104,22 @@ class SharingContext implements Context {
}
/**
+ * @Given user :user deletes file :file
+ *
+ * @param string $user
+ * @param string $file
+ */
+ public function userDeletesFile($user, $file) {
+ $this->currentUser = $user;
+
+ $url = "/$user/$file";
+
+ $this->sendingToDav('DELETE', $url);
+
+ $this->theHTTPStatusCodeShouldBe(204);
+ }
+
+ /**
* @When user :user shares :path with user :sharee
*
* @param string $user
diff --git a/tests/integration/features/sharing/get.feature b/tests/integration/features/sharing/get.feature
index 4e043af6e..319dbbdfa 100644
--- a/tests/integration/features/sharing/get.feature
+++ b/tests/integration/features/sharing/get.feature
@@ -142,6 +142,22 @@ Feature: get
+ Scenario: get a share after deleting its file
+ Given user "participant1" creates room "group room"
+ | roomType | 2 |
+ And user "participant1" renames room "group room" to "Group room" with 200
+ And user "participant1" adds "participant2" to room "group room" with 200
+ And user "participant1" shares "welcome.txt" with room "group room" with OCS 100
+ And user "participant1" deletes file "welcome.txt"
+ When user "participant1" gets last share
+ Then the OCS status code should be "404"
+ And the HTTP status code should be "200"
+ And user "participant2" gets last share
+ And the OCS status code should be "404"
+ And the HTTP status code should be "200"
+
+
+
Scenario: get all shares of a user
Given user "participant1" creates room "own group room"
| roomType | 2 |
@@ -163,6 +179,9 @@ Feature: get
And user "participant1" shares "test" with room "own one-to-one room" with OCS 100
And user "participant2" shares "welcome (2).txt" with user "participant3" with OCS 100
And user "participant3" shares "welcome (2).txt" with room "one-to-one room not invited to" with OCS 100
+ And user "participant1" creates folder "/deleted"
+ And user "participant1" shares "deleted" with room "group room invited to" with OCS 100
+ And user "participant1" deletes file "deleted"
When user "participant1" gets all shares
Then the list of returned shares has 4 shares
And share 0 is returned with
@@ -229,6 +248,10 @@ Feature: get
And user "participant1" shares "test" with room "own one-to-one room" with OCS 100
And user "participant2" shares "welcome (2).txt" with user "participant3" with OCS 100
And user "participant3" shares "welcome (2).txt" with room "one-to-one room not invited to" with OCS 100
+ And user "participant1" creates folder "/deleted"
+ And user "participant1" shares "deleted" with room "group room invited to" with OCS 100
+ And user "participant2" shares "deleted" with user "participant3" with OCS 100
+ And user "participant1" deletes file "deleted"
When user "participant1" gets all shares and reshares
Then the list of returned shares has 6 shares
And share 0 is returned with
@@ -343,6 +366,32 @@ Feature: get
| share_with | group room invited to |
| share_with_displayname | Group room invited to |
+ Scenario: get all shares of a deleted file
+ Given user "participant1" creates room "own group room"
+ | roomType | 2 |
+ And user "participant1" renames room "own group room" to "Own group room" with 200
+ And user "participant2" creates room "group room invited to"
+ | roomType | 2 |
+ And user "participant2" renames room "group room invited to" to "Group room invited to" with 200
+ And user "participant2" adds "participant1" to room "group room invited to" with 200
+ And user "participant1" creates room "own one-to-one room"
+ | roomType | 1 |
+ | invite | participant3 |
+ And user "participant3" creates room "one-to-one room not invited to"
+ | roomType | 1 |
+ | invite | participant4 |
+ And user "participant1" creates folder "/test"
+ And user "participant1" shares "welcome.txt" with room "own group room" with OCS 100
+ And user "participant1" shares "test" with room "group room invited to" with OCS 100
+ And user "participant1" shares "welcome.txt" with room "group room invited to" with OCS 100
+ And user "participant1" shares "test" with room "own one-to-one room" with OCS 100
+ And user "participant2" shares "welcome (2).txt" with user "participant3" with OCS 100
+ And user "participant3" shares "welcome (2).txt" with room "one-to-one room not invited to" with OCS 100
+ And user "participant1" deletes file "welcome.txt"
+ When user "participant1" gets all shares for "/welcome.txt"
+ Then the OCS status code should be "404"
+ And the HTTP status code should be "200"
+
Scenario: get all shares and reshares of a file
Given user "participant1" creates room "own group room"
| roomType | 2 |
@@ -412,6 +461,32 @@ Feature: get
| share_with | one-to-one room not invited to |
| share_with_displayname | participant3-displayname |
+ Scenario: get all shares and reshares of a deleted file
+ Given user "participant1" creates room "own group room"
+ | roomType | 2 |
+ And user "participant1" renames room "own group room" to "Own group room" with 200
+ And user "participant2" creates room "group room invited to"
+ | roomType | 2 |
+ And user "participant2" renames room "group room invited to" to "Group room invited to" with 200
+ And user "participant2" adds "participant1" to room "group room invited to" with 200
+ And user "participant1" creates room "own one-to-one room"
+ | roomType | 1 |
+ | invite | participant3 |
+ And user "participant3" creates room "one-to-one room not invited to"
+ | roomType | 1 |
+ | invite | participant4 |
+ And user "participant1" creates folder "/test"
+ And user "participant1" shares "welcome.txt" with room "own group room" with OCS 100
+ And user "participant1" shares "test" with room "group room invited to" with OCS 100
+ And user "participant1" shares "welcome.txt" with room "group room invited to" with OCS 100
+ And user "participant1" shares "test" with room "own one-to-one room" with OCS 100
+ And user "participant2" shares "welcome (2).txt" with user "participant3" with OCS 100
+ And user "participant3" shares "welcome (2).txt" with room "one-to-one room not invited to" with OCS 100
+ And user "participant1" deletes file "welcome.txt"
+ When user "participant1" gets all shares and reshares for "/welcome.txt"
+ Then the OCS status code should be "404"
+ And the HTTP status code should be "200"
+
Scenario: get all shares of a folder
Given user "participant1" creates room "own group room"
| roomType | 2 |
@@ -473,6 +548,37 @@ Feature: get
| share_with_displayname | Group room invited to |
| permissions | 31 |
+ Scenario: get all shares of a deleted folder
+ Given user "participant1" creates room "own group room"
+ | roomType | 2 |
+ And user "participant1" renames room "own group room" to "Own group room" with 200
+ And user "participant2" creates room "group room invited to"
+ | roomType | 2 |
+ And user "participant2" renames room "group room invited to" to "Group room invited to" with 200
+ And user "participant2" adds "participant1" to room "group room invited to" with 200
+ And user "participant1" creates room "own one-to-one room"
+ | roomType | 1 |
+ | invite | participant3 |
+ And user "participant3" creates room "one-to-one room not invited to"
+ | roomType | 1 |
+ | invite | participant4 |
+ And user "participant1" creates folder "/test"
+ And user "participant1" creates folder "/test/subfolder"
+ And user "participant1" creates folder "/test/subfolder/subsubfolder"
+ And user "participant1" creates folder "/test2"
+ And user "participant1" shares "welcome.txt" with room "own group room" with OCS 100
+ And user "participant1" shares "test/subfolder" with room "group room invited to" with OCS 100
+ And user "participant1" shares "test/subfolder/subsubfolder" with room "group room invited to" with OCS 100
+ And user "participant1" shares "welcome.txt" with room "group room invited to" with OCS 100
+ And user "participant1" shares "test2" with room "own one-to-one room" with OCS 100
+ And user "participant1" moves file "/welcome.txt" to "/test/renamed.txt" with 201
+ And user "participant2" shares "subfolder" with user "participant3" with OCS 100
+ And user "participant3" shares "subfolder" with room "one-to-one room not invited to" with OCS 100
+ And user "participant1" deletes file "test"
+ When user "participant1" gets all shares for "/test" and its subfiles
+ Then the OCS status code should be "404"
+ And the HTTP status code should be "200"
+
Scenario: get all received shares of a user
@@ -493,6 +599,9 @@ Feature: get
And user "participant3" shares "test" with room "group room invited to" with OCS 100
And user "participant2" shares "welcome.txt" with room "group room invited to" with OCS 100
And user "participant3" shares "test" with room "own one-to-one room" with OCS 100
+ And user "participant2" creates folder "/deleted"
+ And user "participant2" shares "deleted" with room "group room invited to" with OCS 100
+ And user "participant2" deletes file "deleted"
When user "participant1" gets all received shares
Then the list of returned shares has 4 shares
And share 0 is returned with
@@ -579,6 +688,29 @@ Feature: get
| share_with | group room invited to |
| share_with_displayname | Group room invited to |
+ Scenario: get all received shares of a deleted file
+ Given user "participant1" creates room "own group room"
+ | roomType | 2 |
+ And user "participant1" renames room "own group room" to "Own group room" with 200
+ And user "participant1" adds "participant2" to room "own group room" with 200
+ And user "participant2" creates room "group room invited to"
+ | roomType | 2 |
+ And user "participant2" renames room "group room invited to" to "Group room invited to" with 200
+ And user "participant2" adds "participant1" to room "group room invited to" with 200
+ And user "participant2" adds "participant3" to room "group room invited to" with 200
+ And user "participant1" creates room "own one-to-one room"
+ | roomType | 1 |
+ | invite | participant3 |
+ And user "participant3" creates folder "/test"
+ And user "participant2" shares "welcome.txt" with room "own group room" with OCS 100
+ And user "participant3" shares "test" with room "group room invited to" with OCS 100
+ And user "participant2" shares "welcome.txt" with room "group room invited to" with OCS 100
+ And user "participant3" shares "test" with room "own one-to-one room" with OCS 100
+ And user "participant2" deletes file "welcome.txt"
+ When user "participant1" gets all received shares for "/welcome (2).txt"
+ Then the OCS status code should be "404"
+ And the HTTP status code should be "200"
+
Scenario: get deleted shares when deleting an own share
@@ -620,6 +752,17 @@ Feature: get
And user "participant3" gets deleted shares
And the list of returned shares has 0 shares
+ Scenario: get deleted shares when deleting the file of an own share
+ Given user "participant1" creates room "group room"
+ | roomType | 2 |
+ And user "participant1" adds "participant2" to room "group room" with 200
+ And user "participant1" shares "welcome.txt" with room "group room" with OCS 100
+ And user "participant1" deletes file "welcome.txt"
+ When user "participant1" gets deleted shares
+ Then the list of returned shares has 0 shares
+ And user "participant2" gets deleted shares
+ And the list of returned shares has 0 shares
+
Scenario: get DAV properties for a share