mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-05-08 04:20:59 -05:00
Merge pull request #8875 from owncloud/issue-8724-coverage
[tests-only][full-ci] adding test for enabling sync of non-existent resource
This commit is contained in:
@@ -297,3 +297,40 @@ Feature: enable or disable sync of incoming shares
|
|||||||
| resource |
|
| resource |
|
||||||
| textfile0.txt |
|
| textfile0.txt |
|
||||||
| FolderToShare |
|
| FolderToShare |
|
||||||
|
|
||||||
|
@issue-8724
|
||||||
|
Scenario: try to enable share sync of a non-existent resource
|
||||||
|
When user "Brian" tries to enable share sync of a non-existent resource using the Graph API
|
||||||
|
Then the HTTP status code should be "400"
|
||||||
|
And the JSON data of the response should match
|
||||||
|
"""
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"required": ["error"],
|
||||||
|
"properties": {
|
||||||
|
"error": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"code",
|
||||||
|
"innererror",
|
||||||
|
"message"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"code" : {
|
||||||
|
"const": "invalidRequest"
|
||||||
|
},
|
||||||
|
"innererror" : {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"date",
|
||||||
|
"request-id"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"message" : {
|
||||||
|
"const": "mounting share failed"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
|||||||
@@ -714,6 +714,26 @@ class SharingNgContext implements Context {
|
|||||||
$this->featureContext->setResponse($response);
|
$this->featureContext->setResponse($response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @When user :user tries to enable share sync of a non-existent resource using the Graph API
|
||||||
|
*
|
||||||
|
* @param string $user
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function userTriesToEnablsShareSyncOfNonExistentResourceUsingTheGraphApi(string $user):void {
|
||||||
|
$shareSpaceId = FeatureContext::SHARES_SPACE_ID;
|
||||||
|
$response = GraphHelper::enableShareSync(
|
||||||
|
$this->featureContext->getBaseUrl(),
|
||||||
|
$this->featureContext->getStepLineRef(),
|
||||||
|
$this->featureContext->getActualUsername($user),
|
||||||
|
$this->featureContext->getPasswordForUser($user),
|
||||||
|
WebDavHelper::generateUUIDv4(),
|
||||||
|
$shareSpaceId
|
||||||
|
);
|
||||||
|
$this->featureContext->setResponse($response);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Then /^user "([^"]*)" should have sync (enabled|disabled) for share "([^"]*)"$/
|
* @Then /^user "([^"]*)" should have sync (enabled|disabled) for share "([^"]*)"$/
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user