From c88e13411153b160f5761c8cb7e7055584e609f2 Mon Sep 17 00:00:00 2001 From: Ashim-Stha Date: Wed, 23 Jul 2025 16:00:18 +0545 Subject: [PATCH] test: add test for creating folder with Transfer-Encoding: chunked header --- tests/acceptance/bootstrap/WebDav.php | 30 ++++++++++++++++++- .../createFileFolder.feature | 10 +++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/tests/acceptance/bootstrap/WebDav.php b/tests/acceptance/bootstrap/WebDav.php index 3cf1debd8b6..32dcf8d1467 100644 --- a/tests/acceptance/bootstrap/WebDav.php +++ b/tests/acceptance/bootstrap/WebDav.php @@ -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 * diff --git a/tests/acceptance/features/coreApiWebdavProperties/createFileFolder.feature b/tests/acceptance/features/coreApiWebdavProperties/createFileFolder.feature index 63b13b7ff94..02b45dd53e5 100644 --- a/tests/acceptance/features/coreApiWebdavProperties/createFileFolder.feature +++ b/tests/acceptance/features/coreApiWebdavProperties/createFileFolder.feature @@ -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