Commit 630ba2fd authored by Sergio Bertolin's avatar Sergio Bertolin
Browse files

Added test for shared_with_me parameter

parent a990e0ac
...@@ -800,7 +800,7 @@ class FeatureContext implements Context, SnippetAcceptingContext { ...@@ -800,7 +800,7 @@ class FeatureContext implements Context, SnippetAcceptingContext {
elseif($contentExpected == "AN_URL"){ elseif($contentExpected == "AN_URL"){
return $this->isExpectedUrl((string)$element->$field, "index.php/s/"); return $this->isExpectedUrl((string)$element->$field, "index.php/s/");
} }
elseif ($element->$field == $contentExpected){ elseif ((string)$element->$field == $contentExpected){
return True; return True;
} }
} }
...@@ -958,6 +958,17 @@ class FeatureContext implements Context, SnippetAcceptingContext { ...@@ -958,6 +958,17 @@ class FeatureContext implements Context, SnippetAcceptingContext {
$this->sendingToWith("GET", $url, null); $this->sendingToWith("GET", $url, null);
} }
/**
* @Then /^last share_id is included in the answer$/
*/
public function findingLastShareID(){
print_r($this->response->xml());
$share_id = $this->lastShareData->data[0]->id;
if (!$this->isFieldInResponse('id', $share_id)){
PHPUnit_Framework_Assert::fail("Share id $share_id not 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
......
...@@ -302,6 +302,16 @@ Feature: sharing ...@@ -302,6 +302,16 @@ Feature: sharing
| file_parent | A_NUMBER | | file_parent | A_NUMBER |
| displayname_owner | user0 | | displayname_owner | user0 |
Scenario: Sharee can see the share
Given user "user0" exists
And user "user1" exists
And file "textfile0.txt" from user "user0" is shared with user "user1"
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 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