Commit 81e0a3ea authored by Sergio Bertolin's avatar Sergio Bertolin
Browse files

Added test and logic for deleting all group shares

parent 630ba2fd
...@@ -961,14 +961,23 @@ class FeatureContext implements Context, SnippetAcceptingContext { ...@@ -961,14 +961,23 @@ class FeatureContext implements Context, SnippetAcceptingContext {
/** /**
* @Then /^last share_id is included in the answer$/ * @Then /^last share_id is included in the answer$/
*/ */
public function findingLastShareID(){ public function checkingLastShareIDIsIncluded(){
print_r($this->response->xml());
$share_id = $this->lastShareData->data[0]->id; $share_id = $this->lastShareData->data[0]->id;
if (!$this->isFieldInResponse('id', $share_id)){ if (!$this->isFieldInResponse('id', $share_id)){
PHPUnit_Framework_Assert::fail("Share id $share_id not found in response"); PHPUnit_Framework_Assert::fail("Share id $share_id not found in response");
} }
} }
/**
* @Then /^last share_id is not included in the answer$/
*/
public function checkingLastShareIDIsNotIncluded(){
$share_id = $this->lastShareData->data[0]->id;
if ($this->isFieldInResponse('id', $share_id)){
PHPUnit_Framework_Assert::fail("Share id $share_id has been found in response");
}
}
/** /**
* @Then /^Share fields of last share match with$/ * @Then /^Share fields of last share match with$/
* @param \Behat\Gherkin\Node\TableNode|null $formData * @param \Behat\Gherkin\Node\TableNode|null $formData
......
...@@ -312,6 +312,22 @@ Feature: sharing ...@@ -312,6 +312,22 @@ Feature: sharing
And the HTTP status code should be "200" And the HTTP status code should be "200"
And last share_id is included in the answer And last share_id is included in the answer
Scenario: Delete all group shares
Given As an "admin"
And user "user0" exists
And user "user1" exists
And group "group1" exists
And user "user1" belongs to group "group1"
And file "textfile0.txt" from user "user0" is shared with group "group1"
And User "user1" moved file "/textfile0.txt" to "/FOLDER/textfile0.txt"
And As an "user0"
And Deleting last share
And As an "user1"
When sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true"
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And last share_id is not included in the answer
Scenario: delete a share Scenario: delete a share
Given user "user0" exists Given user "user0" exists
And user "user1" exists And user "user1" exists
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment