[tests-only] removing the setresponse in given/when/then step in ocs and webdavlocking context (#7347)

* 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-02 17:00:04 +05:45
committed by GitHub
parent eb1aa4502e
commit 87f1235562
5 changed files with 213 additions and 138 deletions
@@ -2970,14 +2970,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');