[tests-only] removing the setresponse in given/when/then step in webdavproperties context (#7368)

* refactor given and when steps in webdavproperties context

* change the status code in tests as the when step sets the response now

* correct the status code check

* only save response

* use getResponseXml to get xml response object

* fix isEtagValid method

* rename step def methods

* make stricter checks

---------

Co-authored-by: Saw-jan <saw.jan.grg3e@gmail.com>
This commit is contained in:
Karun Atreya
2023-10-05 09:55:11 +05:45
committed by GitHub
parent 6fb05986ed
commit b0455f03e6
7 changed files with 236 additions and 288 deletions
@@ -2740,8 +2740,8 @@ class SpacesContext implements Context {
*/
public function userGetsEtagOfElementInASpace(string $user, string $space, string $path) {
$this->setSpaceIDByName($user, $space);
$this->webDavPropertiesContext->storeEtagOfElement($user, $path);
return $this->featureContext->getEtagFromResponseXmlObject();
$xmlObject = $this->webDavPropertiesContext->storeEtagOfElement($user, $path);
return $this->featureContext->getEtagFromResponseXmlObject($xmlObject);
}
/**
@@ -3019,7 +3019,8 @@ class SpacesContext implements Context {
TableNode $propertiesTable
):void {
$this->setSpaceIDByName($user, $spaceName);
$this->webDavPropertiesContext->userGetsPropertiesOfFolder($user, $resourceName, $propertiesTable);
$response = $this->webDavPropertiesContext->getPropertiesOfFolder($user, $resourceName, $propertiesTable);
$this->featureContext->setResponse($response);
}
/**