refactor setting response in given/when/then steps in ocs and webdavlocking context (#7413)

refactor given and when steps in ocs and webdav locking context

use the returned response

use of returned response from helper function

made changes to the affected test steps

deleted vardump line
This commit is contained in:
Karun Atreya
2023-10-05 16:56:31 +05:45
committed by GitHub
parent b85396a3c0
commit f2f3f546b4
5 changed files with 213 additions and 138 deletions
@@ -2980,14 +2980,14 @@ class SpacesContext implements Context {
$url = "/apps/files_sharing/api/v1/shares?reshares=true&space_ref=" . $body;
$this->ocsContext->userSendsHTTPMethodToOcsApiEndpointWithBody(
$response = $this->ocsContext->userSendsHTTPMethodToOcsApiEndpointWithBody(
$user,
'GET',
$url,
);
$should = ($shouldOrNot !== "not");
$responseArray = json_decode(json_encode($this->featureContext->getResponseXml()->data), true, 512, JSON_THROW_ON_ERROR);
$responseArray = json_decode(json_encode($this->featureContext->getResponseXml($response)->data), true, 512, JSON_THROW_ON_ERROR);
if ($should) {
Assert::assertNotEmpty($responseArray, __METHOD__ . ' Response should contain a link, but it is empty');