diff options
author | Sergio Bertolin <sbertolin@solidgear.es> | 2015-11-04 13:42:14 +0000 |
---|---|---|
committer | Sergio Bertolin <sbertolin@solidgear.es> | 2015-11-04 13:42:14 +0000 |
commit | 3b7690f84204303de84db96da0bf6812f01bc612 (patch) | |
tree | 9e7ff52bce83f62e61c035e87bfa175a46f6d137 /build | |
parent | 05933815223043ddbe5bbcdaa7afb02801243739 (diff) | |
download | nextcloud-server-3b7690f84204303de84db96da0bf6812f01bc612.tar.gz nextcloud-server-3b7690f84204303de84db96da0bf6812f01bc612.zip |
added test for deleting a share
Diffstat (limited to 'build')
-rw-r--r-- | build/integration/features/bootstrap/FeatureContext.php | 11 | ||||
-rw-r--r-- | build/integration/features/sharing-v1.feature | 9 |
2 files changed, 19 insertions, 1 deletions
diff --git a/build/integration/features/bootstrap/FeatureContext.php b/build/integration/features/bootstrap/FeatureContext.php index a8ab5dc04e8..d3a04ee782e 100644 --- a/build/integration/features/bootstrap/FeatureContext.php +++ b/build/integration/features/bootstrap/FeatureContext.php @@ -659,6 +659,7 @@ class FeatureContext implements Context, SnippetAcceptingContext { try { $this->response = $client->send($client->createRequest("POST", $fullUrl, $options)); + $this->lastShareData = $this->response->xml(); } catch (\GuzzleHttp\Exception\ClientException $ex) { $this->response = $ex->getResponse(); } @@ -695,7 +696,15 @@ class FeatureContext implements Context, SnippetAcceptingContext { } $this->response = $client->get($fullUrl, $options); PHPUnit_Framework_Assert::assertEquals(True, $this->isUserInSharedData($user2)); - + } + + /** + * @When /^Deleting last share$/ + */ + public function deletingLastShare(){ + $share_id = $this->lastShareData->data[0]->id; + $url = "/apps/files_sharing/api/v{$this->apiVersion}/shares/$share_id"; + $this->sendingToWith("DELETE", $url, null); } public static function removeFile($path, $filename){ diff --git a/build/integration/features/sharing-v1.feature b/build/integration/features/sharing-v1.feature index 0f9953bcccf..b7bd8b70db7 100644 --- a/build/integration/features/sharing-v1.feature +++ b/build/integration/features/sharing-v1.feature @@ -67,6 +67,15 @@ Feature: sharing Then the OCS status code should be "100" And the HTTP status code should be "200" + Scenario: delete a share + Given user "user0" exists + And user "user1" exists + And file "textfile0.txt" from user "user0" is shared with user "user1" + And As an "user0" + When Deleting last share + Then the OCS status code should be "100" + And the HTTP status code should be "200" + |