test: add test for moving folder with Transfer-Encoding: chunked header

Signed-off-by: Ashim-Stha <ashimshrestha2384@gmail.com>
This commit is contained in:
Ashim-Stha committed 2025-08-04 10:08:40 +05:45
1 parent a63e759d5b
commit eb273c742b
2 files changed
+54 -1

No files matched your search

+34 -1
View File
@@ -507,10 +507,16 @@ trait WebDav {
* @param string $user
* @param string $source
* @param string $destination
* @param array|null $headers
*
* @return ResponseInterface
*/
public function moveResource(string $user, string $source, string $destination): ResponseInterface {
public function moveResource(
string $user,
string $source,
string $destination,
?array $headers = [],
): ResponseInterface {
$user = $this->getActualUsername($user);
$headers['Destination'] = $this->destinationHeaderValue(
$user,
@@ -546,6 +552,33 @@ trait WebDav {
$this->pushToLastHttpStatusCodesArray();
}
/**
* @When user :user moves file/folder :source to :destination with the following headers using the WebDAV API
*
* @param string $user
* @param string $source
* @param string $destination
* @param TableNode $table
*
* @return void
* @throws JsonException
* @throws GuzzleException
*/
public function userMovesResourceWithTheFollowingHeadersUsingTheWebDavAPI(
string $user,
string $source,
string $destination,
TableNode $table,
): void {
$headers = [];
foreach ($table->getColumnsHash() as $header) {
$headers[$header["header"]] = $header["value"];
}
$response = $this->moveResource($user, $source, $destination, $headers);
$this->setResponse($response);
$this->pushToLastHttpStatusCodesArray();
}
/**
* @When user :user moves the following file using the WebDAV API
*
@@ -264,3 +264,23 @@ Feature: move (rename) folder
| old |
| new |
| spaces |
@issue-10809
Scenario Outline: move a folder with Transfer-Encoding: chunked header
Given using <dav-path-version> DAV path
And user "Alice" has created folder "folder1"
And user "Alice" has created folder "folder2"
When user "Alice" moves folder "folder2" to "folder1/folder2" with the following headers using the WebDAV API
| header | value |
# NOTE: requires system curl version >= 8.12.0
| Transfer-Encoding | chunked |
Then the HTTP status code should be "201"
And user "Alice" should not see the following elements
| folder2 |
And user "Alice" should see the following elements
| folder1/folder2 |
Examples:
| dav-path-version |
| old |
| new |
| spaces |