Skip to content

Commit

Permalink
address reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
saw-jan authored and SwikritiT committed Jan 9, 2024
1 parent 6a0182a commit 7fd874b
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
34 changes: 34 additions & 0 deletions tests/TestHelpers/GraphHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1702,6 +1702,40 @@ public static function updateLinkShare(
);
}

/**
* @param string $baseUrl
* @param string $xRequestId
* @param string $user
* @param string $password
* @param string $spaceId
* @param string $itemId
* @param mixed $body
* @param string $permissionsId
*
* @return ResponseInterface
* @throws GuzzleException
*/
public static function setLinkSharePassword(
string $baseUrl,
string $xRequestId,
string $user,
string $password,
string $spaceId,
string $itemId,
$body,
string $permissionsId
): ResponseInterface {
$url = self::getBetaFullUrl($baseUrl, "drives/$spaceId/items/$itemId/permissions/$permissionsId/setPassword");
return HttpRequestHelper::post(
$url,
$xRequestId,
$user,
$password,
self::getRequestHeaders(),
$body
);
}

/**
* @param string $baseUrl
* @param string $xRequestId
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/features/bootstrap/Sharing.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public function shareNgGetLastCreatedLinkShareToken(): string {
/**
* @return string
*/
public function shareNgGetLastCreatedUserShareShareID(): string {
public function shareNgGetLastCreatedUserGroupShareID(): string {
$lastResponse = $this->shareNgGetLastCreatedUserGroupShare();
if (!isset($this->getJsonDecodedResponse($lastResponse)['value'][0]['id'])) {
throw new Error('Response did not contain share id for the last created share.');
Expand Down
6 changes: 3 additions & 3 deletions tests/acceptance/features/bootstrap/SharingNgContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ public function sendShareInvitation(string $user, TableNode $table): ResponseInt
$itemId,
$shareeId,
$rows['shareType'],
$role,
$permission,
$permissionsRole,
$permissionsAction,
$expireDate
);
if ($response->getStatusCode() === 200) {
Expand Down Expand Up @@ -354,7 +354,7 @@ public function userRemovesSharePermissionOfUserFromResourceOfSpaceUsingGraphAPI
$itemId = ($resourceType === 'folder')
? $this->spacesContext->getResourceId($sharer, $space, $resource)
: $this->spacesContext->getFileId($sharer, $space, $resource);
$permId = $this->featureContext->shareNgGetLastCreatedUserShareShareID();
$permId = $this->featureContext->shareNgGetLastCreatedUserGroupShareID();
$this->featureContext->setResponse(
GraphHelper::deleteSharePermission(
$this->featureContext->getBaseUrl(),
Expand Down

0 comments on commit 7fd874b

Please sign in to comment.