added test for deleting a share
This commit is contained in:
parent
0593381522
commit
3b7690f842
|
@ -659,6 +659,7 @@ class FeatureContext implements Context, SnippetAcceptingContext {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$this->response = $client->send($client->createRequest("POST", $fullUrl, $options));
|
$this->response = $client->send($client->createRequest("POST", $fullUrl, $options));
|
||||||
|
$this->lastShareData = $this->response->xml();
|
||||||
} catch (\GuzzleHttp\Exception\ClientException $ex) {
|
} catch (\GuzzleHttp\Exception\ClientException $ex) {
|
||||||
$this->response = $ex->getResponse();
|
$this->response = $ex->getResponse();
|
||||||
}
|
}
|
||||||
|
@ -695,7 +696,15 @@ class FeatureContext implements Context, SnippetAcceptingContext {
|
||||||
}
|
}
|
||||||
$this->response = $client->get($fullUrl, $options);
|
$this->response = $client->get($fullUrl, $options);
|
||||||
PHPUnit_Framework_Assert::assertEquals(True, $this->isUserInSharedData($user2));
|
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){
|
public static function removeFile($path, $filename){
|
||||||
|
|
|
@ -67,6 +67,15 @@ Feature: sharing
|
||||||
Then the OCS status code should be "100"
|
Then the OCS status code should be "100"
|
||||||
And the HTTP status code should be "200"
|
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"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue