summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-12-10 10:36:12 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-12-10 10:36:12 +0100
commit6ca9444b49134a7d27241d90d8bfe1dfd1e2fd76 (patch)
treee9442046a338ccf013d646c113fe3cbfbd2ba312
parent9f4ceef7c9230c0f7e453e6345f59923a54c40ed (diff)
parent93f4524a9135d52abdf6fd3ba2962aa5a581aa68 (diff)
downloadnextcloud-server-6ca9444b49134a7d27241d90d8bfe1dfd1e2fd76.tar.gz
nextcloud-server-6ca9444b49134a7d27241d90d8bfe1dfd1e2fd76.zip
Merge pull request #20893 from owncloud/test_sharing_file_by_multiple_channels
Added shared by multiple channels test
-rw-r--r--build/integration/features/bootstrap/WebDav.php23
-rw-r--r--build/integration/features/sharing-v1.feature41
2 files changed, 63 insertions, 1 deletions
diff --git a/build/integration/features/bootstrap/WebDav.php b/build/integration/features/bootstrap/WebDav.php
index a682467f52d..49cd565cf26 100644
--- a/build/integration/features/bootstrap/WebDav.php
+++ b/build/integration/features/bootstrap/WebDav.php
@@ -97,6 +97,15 @@ trait WebDav{
PHPUnit_Framework_Assert::assertEquals($content, (string)$this->response->getBody());
}
+ /**
+ * @Then /^Downloaded content when downloading file "([^"]*)" with range "([^"]*)" should be "([^"]*)"$/
+ */
+ public function downloadedContentWhenDownloadindShouldBe($fileSource, $range, $content){
+ $this->downloadFileWithRange($fileSource, $range);
+ $this->downloadedContentShouldBe($content);
+ }
+
+
/*Returns the elements of a propfind, $folderDepth requires 1 to see elements without children*/
public function listFolder($user, $path, $folderDepth){
$fullUrl = substr($this->baseUrl, 0, -4);
@@ -126,7 +135,7 @@ trait WebDav{
* @param \Behat\Gherkin\Node\TableNode|null $expectedElements
*/
public function checkElementList($user, $expectedElements){
- $elementList = $this->listFolder($user, '/', 2);
+ $elementList = $this->listFolder($user, '/', 3);
if ($expectedElements instanceof \Behat\Gherkin\Node\TableNode) {
$elementRows = $expectedElements->getRows();
$elementsSimplified = $this->simplifyArray($elementRows);
@@ -153,5 +162,17 @@ trait WebDav{
}
}
+ /**
+ * @Given User :user created a folder :destination
+ */
+ public function userCreatedAFolder($user, $destination){
+ try {
+ $this->response = $this->makeDavRequest($user, "MKCOL", $destination, []);
+ } catch (\GuzzleHttp\Exception\ServerException $e) {
+ // 4xx and 5xx responses cause an exception
+ $this->response = $e->getResponse();
+ }
+ }
+
}
diff --git a/build/integration/features/sharing-v1.feature b/build/integration/features/sharing-v1.feature
index e00fd47baeb..31ba0d4ad7f 100644
--- a/build/integration/features/sharing-v1.feature
+++ b/build/integration/features/sharing-v1.feature
@@ -379,6 +379,47 @@ Feature: sharing
| /CHILD/child.txt |
And the HTTP status code should be "200"
+ Scenario: Share a file by multiple channels
+ Given As an "admin"
+ And user "user0" exists
+ And user "user1" exists
+ And user "user2" exists
+ And group "group0" exists
+ And user "user1" belongs to group "group0"
+ And user "user2" belongs to group "group0"
+ And user "user0" created a folder "/common"
+ And user "user0" created a folder "/common/sub"
+ And file "common" of user "user0" is shared with group "group0"
+ And file "textfile0.txt" of user "user1" is shared with user "user2"
+ And User "user1" moved file "/textfile0.txt" to "/common/textfile0.txt"
+ And User "user1" moved file "/common/textfile0.txt" to "/common/sub/textfile0.txt"
+ And As an "user2"
+ When Downloading file "/common/sub/textfile0.txt" with range "bytes=9-17"
+ Then Downloaded content should be "test text"
+ And Downloaded content when downloading file "/textfile0.txt" with range "bytes=9-17" should be "test text"
+ And user "user2" should see following elements
+ | /common/sub/textfile0.txt |
+
+ Scenario: Share a file by multiple channels
+ Given As an "admin"
+ And user "user0" exists
+ And user "user1" exists
+ And user "user2" exists
+ And group "group0" exists
+ And user "user1" belongs to group "group0"
+ And user "user2" belongs to group "group0"
+ And user "user0" created a folder "/common"
+ And user "user0" created a folder "/common/sub"
+ And file "common" of user "user0" is shared with group "group0"
+ And file "textfile0.txt" of user "user1" is shared with user "user2"
+ And User "user1" moved file "/textfile0.txt" to "/common/textfile0.txt"
+ And User "user1" moved file "/common/textfile0.txt" to "/common/sub/textfile0.txt"
+ And As an "user2"
+ When Downloading file "/textfile0.txt" with range "bytes=9-17"
+ Then Downloaded content should be "test text"
+ And user "user2" should see following elements
+ | /common/sub/textfile0.txt |
+
Scenario: Delete all group shares
Given As an "admin"
And user "user0" exists