Merge pull request #11556 from Ashim-Stha/createFolderWithHeader

[tests-only][full-ci] Add test for creating folder with `Transfer-Encoding: chunked` header
This commit is contained in:
nirajacharya2 authored and GitHub committed 2025-07-31 10:35:18 +05:45
commit 4bec7e2cdd
2 files changed
+39 -1

No files matched your search

+29 -1
View File
@@ -339,6 +339,7 @@ trait WebDav {
* @param bool|null $isGivenStep
* @param string|null $password
* @param string|null $spaceId
* @param array|null $headers
*
* @return ResponseInterface
* @throws JsonException | GuzzleException
@@ -350,12 +351,13 @@ trait WebDav {
?bool $isGivenStep = false,
?string $password = null,
?string $spaceId = null,
?array $headers = [],
): ResponseInterface {
return $this->makeDavRequest(
$user,
"MKCOL",
$folder,
[],
$headers,
null,
$spaceId,
"files",
@@ -2729,6 +2731,32 @@ trait WebDav {
$this->setResponse($response);
}
/**
* @When user :user creates folder :destination with the following headers using the WebDAV API
*
* @param string $user
* @param string $destination
* @param TableNode $table
*
* @return void
* @throws JsonException
* @throws GuzzleException
*/
public function userCreatesFolderWithTheFollowingHeadersUsingTheWebDavApi(
string $user,
string $destination,
TableNode $table,
): void {
$headers = [];
foreach ($table->getColumnsHash() as $header) {
$headerName = $header['header'];
$headerValue = $header['value'];
$headers[$headerName] = $headerValue;
}
$response = $this->createFolder(user: $user, folder: $destination, headers: $headers);
$this->setResponse($response);
}
/**
* @Given user :user has created folder :destination
*
@@ -264,3 +264,13 @@ Feature: create files and folder
| spaces | /..fo |
| spaces | /fo.xyz |
| spaces | /fo.exe |
@issue-10809
Scenario: create a folder with Transfer-Encoding: chunked header
Given using spaces DAV path
When user "Alice" creates folder "myFolder" 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 as "Alice" folder "myFolder" should exist