fix steps

This commit is contained in:
Saw-jan
2023-10-06 14:55:38 +05:45
committed by Sawjan Gurung
parent e439deaba9
commit c138bc68fd
2 changed files with 5 additions and 2 deletions
+2
View File
@@ -657,6 +657,8 @@ class HttpRequestHelper {
* @return array
*/
public static function parseResponseAsXml(ResponseInterface $response):array {
// rewind so that we can reparse it if it was parsed already
$response->getBody()->rewind();
$body = $response->getBody()->getContents();
$parsedResponse = [];
if ($body && \substr($body, 0, 1) === '<') {
@@ -3702,7 +3702,7 @@ trait WebDav {
$admin,
__METHOD__ . "The provided user is not admin but '" . $admin . "'"
);
$response = $this->createFolder($user, $destination, true);
$response = $this->createFolder($admin, $destination, true);
$this->theHTTPStatusCodeShouldBe(
["201", "204"],
"HTTP status code was not 201 or 204 while trying to create folder '$destination' for admin '$admin'",
@@ -4825,10 +4825,11 @@ trait WebDav {
* @throws Exception
*/
public function theDavElementShouldBe(string $element, string $message):void {
$resXmlArray = HttpRequestHelper::parseResponseAsXml($this->getResponse());
WebDavAssert::assertDavResponseElementIs(
$element,
$message,
$this->responseXml,
$resXmlArray,
__METHOD__
);
}