tests: refactor send profind request to space function (#7835)

This commit is contained in:
Swikriti Tripathi
2023-11-29 11:25:01 +05:45
committed by GitHub
parent 4d14e048d9
commit 0d9f676901
2 changed files with 33 additions and 17 deletions
@@ -914,9 +914,9 @@ class WebDavLockingContext implements Context {
* @throws GuzzleException
*/
public function numberOfLockShouldBeReportedInProjectSpace(int $count, string $file, string $spaceName, string $user) {
$this->spacesContext->userSendsPropfindRequestToSpace($user, $spaceName, $file);
$this->featureContext->theHTTPStatusCodeShouldBe(207, "");
$responseXml = $this->featureContext->getResponseXml();
$response = $this->spacesContext->sendPropfindRequestToSpace($user, $spaceName, $file);
$this->featureContext->theHTTPStatusCodeShouldBe(207, "", $response);
$responseXml = $this->featureContext->getResponseXml($response);
$xmlPart = $responseXml->xpath("//d:response//d:lockdiscovery/d:activelock");
if (\is_array($xmlPart)) {
$lockCount = \count($xmlPart);