Merge pull request #6380 from owncloud/uploadAfterRenaming
[test-only] ApiTest. Upload file after renaming first
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
@api
|
@api
|
||||||
Feature: upload resources using TUS protocol
|
Feature: upload resources using TUS protocol
|
||||||
As a user
|
As a user
|
||||||
I want to be able to upload files
|
I want to be able to upload files
|
||||||
@@ -32,3 +32,11 @@ Feature: upload resources using TUS protocol
|
|||||||
And for user "Alice" the space "Project Jupiter" should not contain these entries:
|
And for user "Alice" the space "Project Jupiter" should not contain these entries:
|
||||||
| upload.txt |
|
| upload.txt |
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: upload the same file after renaming the first one
|
||||||
|
Given user "Alice" has uploaded a file with content "uploaded content" to "/upload.txt" via TUS inside of the space "Alice Hansen"
|
||||||
|
And user "Alice" has moved file "upload.txt" to "test.txt" in space "Alice Hansen"
|
||||||
|
When user "Alice" uploads a file with content "uploaded content" to "/upload.txt" via TUS inside of the space "Alice Hansen" using the WebDAV API
|
||||||
|
Then for user "Alice" the space "Alice Hansen" should contain these entries:
|
||||||
|
| test.txt |
|
||||||
|
| upload.txt |
|
||||||
|
|||||||
@@ -1587,6 +1587,7 @@ class SpacesContext implements Context {
|
|||||||
$fileDestination,
|
$fileDestination,
|
||||||
$spaceName
|
$spaceName
|
||||||
);
|
);
|
||||||
|
$headers['Overwrite'] = 'F';
|
||||||
|
|
||||||
$fileSource = $this->escapePath(\trim($fileSource, "/"));
|
$fileSource = $this->escapePath(\trim($fileSource, "/"));
|
||||||
$fullUrl = $space["root"]["webDavUrl"] . '/' . $fileSource;
|
$fullUrl = $space["root"]["webDavUrl"] . '/' . $fileSource;
|
||||||
|
|||||||
@@ -150,6 +150,30 @@ class SpacesTUSContext implements Context {
|
|||||||
$this->tusContext->userUploadsAFileWithContentToUsingTus($user, $content, $resource);
|
$this->tusContext->userUploadsAFileWithContentToUsingTus($user, $content, $resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @When /^user "([^"]*)" has uploaded a file with content "([^"]*)" to "([^"]*)" via TUS inside of the space "([^"]*)"$/
|
||||||
|
*
|
||||||
|
* @param string $user
|
||||||
|
* @param string $content
|
||||||
|
* @param string $resource
|
||||||
|
* @param string $spaceName
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @throws Exception|GuzzleException
|
||||||
|
*/
|
||||||
|
public function userHasUploadedAFileWithContentToViaTusInsideOfTheSpace(
|
||||||
|
string $user,
|
||||||
|
string $content,
|
||||||
|
string $resource,
|
||||||
|
string $spaceName
|
||||||
|
): void {
|
||||||
|
$this->userUploadsAFileWithContentToViaTusInsideOfTheSpaceUsingTheWebdavApi($user, $content, $resource, $spaceName);
|
||||||
|
$this->featureContext->theHTTPStatusCodeShouldBe(
|
||||||
|
200,
|
||||||
|
"Expected response status code should be 200"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @When /^user "([^"]*)" uploads a file "([^"]*)" to "([^"]*)" with mtime "([^"]*)" via TUS inside of the space "([^"]*)" using the WebDAV API$/
|
* @When /^user "([^"]*)" uploads a file "([^"]*)" to "([^"]*)" with mtime "([^"]*)" via TUS inside of the space "([^"]*)" using the WebDAV API$/
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user