Skip to content

Commit

Permalink
Merge pull request #4502 from owncloud/header-deleteSpace
Browse files Browse the repository at this point in the history
[tests-only] Hardcode header in GraphHelper::deleteSpace
  • Loading branch information
SwikritiT authored Sep 2, 2022
2 parents c2e44b1 + 7266408 commit 2043b4b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
21 changes: 10 additions & 11 deletions tests/TestHelpers/GraphHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ public static function preparePatchUserPayload(
}
return \json_encode($payload);
}

/**
* Send Graph Create Space Request
*
Expand Down Expand Up @@ -668,13 +668,13 @@ public static function getSingleSpace(

/**
* send disable space request
*
*
* @param string $baseUrl
* @param string $user
* @param string $password
* @param string $spaceId
* @param string $xRequestId
*
*
* @return ResponseInterface
* @throws GuzzleException
*/
Expand All @@ -686,7 +686,7 @@ public static function disableSpace(
string $xRequestId = ''
): ResponseInterface {
$url = self::getFullUrl($baseUrl, 'drives/' . $spaceId);

return HttpRequestHelper::delete(
$url,
$xRequestId,
Expand All @@ -697,14 +697,13 @@ public static function disableSpace(

/**
* send delete space request
*
*
* @param string $baseUrl
* @param string $user
* @param string $password
* @param string $spaceId
* @param array $header
* @param string $xRequestId
*
*
* @return ResponseInterface
* @throws GuzzleException
*/
Expand All @@ -713,11 +712,11 @@ public static function deleteSpace(
string $user,
string $password,
string $spaceId,
array $header,
string $xRequestId = ''
): ResponseInterface {
$url = self::getFullUrl($baseUrl, 'drives/' . $spaceId);

$header = ["Purge" => "T"];

return HttpRequestHelper::delete(
$url,
$xRequestId,
Expand Down Expand Up @@ -750,7 +749,7 @@ public static function restoreSpace(

return HttpRequestHelper::sendRequest($url, '', 'PATCH', $user, $password, $header, $body);
}

/**
* @param string $baseUrl
* @param string $xRequestId
Expand All @@ -773,7 +772,7 @@ public static function changeOwnPassword(
$url = self::getFullUrl($baseUrl, 'me/changePassword');
$payload['currentPassword'] = $currentPassword;
$payload['newPassword'] = $newPassword;

return HttpRequestHelper::sendRequest(
$url,
$xRequestId,
Expand Down
6 changes: 2 additions & 4 deletions tests/acceptance/features/bootstrap/SpacesContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -2334,16 +2334,14 @@ public function sendDeleteSpaceRequest(
string $user,
string $spaceName
): void {
$header = ["Purge" => "T"];
$space = $this->getSpaceByName($user, $spaceName);

$this->featureContext->setResponse(
GraphHelper::deleteSpace(
$this->featureContext->getBaseUrl(),
$user,
$this->featureContext->getPasswordForUser($user),
$space["id"],
$header
$space["id"]
)
);
}
Expand Down

0 comments on commit 2043b4b

Please sign in to comment.