@@ -339,6 +339,7 @@ public function makeDavRequest(
339339 * @param bool|null $isGivenStep
340340 * @param string|null $password
341341 * @param string|null $spaceId
342+ * @param array|null $headers
342343 *
343344 * @return ResponseInterface
344345 * @throws JsonException | GuzzleException
@@ -350,12 +351,13 @@ public function createFolder(
350351 ?bool $ isGivenStep = false ,
351352 ?string $ password = null ,
352353 ?string $ spaceId = null ,
354+ ?array $ headers = [],
353355 ): ResponseInterface {
354356 return $ this ->makeDavRequest (
355357 $ user ,
356358 "MKCOL " ,
357359 $ folder ,
358- [] ,
360+ $ headers ,
359361 null ,
360362 $ spaceId ,
361363 "files " ,
@@ -2729,6 +2731,32 @@ public function userCreatesFolder(string $user, string $destination): void {
27292731 $ this ->setResponse ($ response );
27302732 }
27312733
2734+ /**
2735+ * @When user :user creates folder :destination with the following headers using the WebDAV API
2736+ *
2737+ * @param string $user
2738+ * @param string $destination
2739+ * @param TableNode $table
2740+ *
2741+ * @return void
2742+ * @throws JsonException
2743+ * @throws GuzzleException
2744+ */
2745+ public function userCreatesFolderWithTheFollowingHeadersUsingTheWebDavApi (
2746+ string $ user ,
2747+ string $ destination ,
2748+ TableNode $ table ,
2749+ ): void {
2750+ $ headers = [];
2751+ foreach ($ table ->getColumnsHash () as $ header ) {
2752+ $ headerName = $ header ['header ' ];
2753+ $ headerValue = $ header ['value ' ];
2754+ $ headers [$ headerName ] = $ headerValue ;
2755+ }
2756+ $ response = $ this ->createFolder (user: $ user , folder: $ destination , headers: $ headers );
2757+ $ this ->setResponse ($ response );
2758+ }
2759+
27322760 /**
27332761 * @Given user :user has created folder :destination
27342762 *
0 commit comments