mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-04-29 03:33:10 -04:00
added test to create odt file inside deleted parent folder
This commit is contained in:
@@ -205,4 +205,27 @@ class CollaborationContext implements Context {
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @When user :user tries to create a file :file inside deleted folder using wopi endpoint
|
||||
*
|
||||
* @param string $user
|
||||
* @param string $file
|
||||
*
|
||||
* @return void
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function userTriesToCreateAFileInsideDeletedFolderUsingWopiEndpoint(string $user, string $file): void {
|
||||
$parentContainerId = $this->featureContext->getStoredFileID();
|
||||
$this->featureContext->setResponse(
|
||||
CollaborationHelper::createFile(
|
||||
$this->featureContext->getBaseUrl(),
|
||||
$this->featureContext->getStepLineRef(),
|
||||
$user,
|
||||
$this->featureContext->getPasswordForUser($user),
|
||||
$parentContainerId,
|
||||
$file
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -986,3 +986,29 @@ Feature: collaboration (wopi)
|
||||
}
|
||||
"""
|
||||
And as "Alice" file "publicFolder/simple.odt" should not exist
|
||||
|
||||
|
||||
Scenario: user tries to create odt file inside deleted parent folder using wopi endpoint
|
||||
Given user "Alice" has created folder "testFolder"
|
||||
And user "Alice" has stored id of folder "testFolder"
|
||||
And user "Alice" has deleted folder "testFolder"
|
||||
When user "Alice" tries to create a file "simple.odt" inside deleted folder using wopi endpoint
|
||||
Then the HTTP status code should be "404"
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"code",
|
||||
"message"
|
||||
],
|
||||
"properties": {
|
||||
"code": {
|
||||
"const": "RESOURCE_NOT_FOUND"
|
||||
},
|
||||
"message": {
|
||||
"const": "the parent container is not accessible or does not exist"
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user