Skip to content

Commit

Permalink
made changes to the affected test steps
Browse files Browse the repository at this point in the history
  • Loading branch information
KarunAtreya committed Sep 27, 2023
1 parent 42aa51b commit 567ae26
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
3 changes: 2 additions & 1 deletion tests/acceptance/features/bootstrap/ShareesContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,12 @@ public function userGetsTheShareesWithParameters(string $user, TableNode $body):
$url .= '?' . \implode('&', $parameters);
}

$this->ocsContext->userSendsHTTPMethodToOcsApiEndpointWithBody(
$response = $this->ocsContext->userSendsHTTPMethodToOcsApiEndpointWithBody(
$user,
'GET',
$url
);
$this->featureContext->setResponse($response);
}

/**
Expand Down
28 changes: 17 additions & 11 deletions tests/acceptance/features/bootstrap/Sharing.php
Original file line number Diff line number Diff line change
Expand Up @@ -2150,13 +2150,14 @@ public function userGetsFilteredSharesSharedWithHimUsingTheSharingApi(string $us
} else {
$rawShareTypes = SharingHelper::SHARE_TYPES[$shareType];
}
$this->ocsContext->userSendsHTTPMethodToOcsApiEndpointWithBody(
$response = $this->ocsContext->userSendsHTTPMethodToOcsApiEndpointWithBody(
$user,
'GET',
$this->getSharesEndpointPath(
"?shared_with_me=true" . $pendingClause . "&share_types=" . $rawShareTypes
)
);
$this->setResponse($response);
}

/**
Expand All @@ -2171,11 +2172,12 @@ public function userGetsAllSharesSharedWithHimFromFileOrFolderUsingTheProvisioni
$user = $this->getActualUsername($user);
$url = "/apps/files_sharing/api/"
. "v$this->sharingApiVersion/shares?shared_with_me=true&path=$path";
$this->ocsContext->userSendsHTTPMethodToOcsApiEndpointWithBody(
$response = $this->ocsContext->userSendsHTTPMethodToOcsApiEndpointWithBody(
$user,
'GET',
$url
);
$this->setResponse($response);
}

/**
Expand Down Expand Up @@ -3029,17 +3031,17 @@ public function getPublicShareIDByName(string $user, string $path, string $name)
* @param string $name
* @param string $path
*
* @return void
* @return ResponseInterface
*/
public function deletePublicLinkShareUsingTheSharingApi(
string $user,
string $name,
string $path
):void {
):ResponseInterface {
$user = $this->getActualUsername($user);
$share_id = $this->getPublicShareIDByName($user, $path, $name);
$url = $this->getSharesEndpointPath("/$share_id");
$this->ocsContext->userSendsHTTPMethodToOcsApiEndpointWithBody(
return $this->ocsContext->userSendsHTTPMethodToOcsApiEndpointWithBody(
$user,
"DELETE",
$url
Expand All @@ -3060,11 +3062,12 @@ public function userDeletesPublicLinkShareNamedUsingTheSharingApi(
string $name,
string $path
):void {
$this->deletePublicLinkShareUsingTheSharingApi(
$response = $this->deletePublicLinkShareUsingTheSharingApi(
$user,
$name,
$path
);
$this->setResponse($response);
}

/**
Expand All @@ -3081,12 +3084,12 @@ public function userHasDeletedPublicLinkShareNamedUsingTheSharingApi(
string $name,
string $path
):void {
$this->deletePublicLinkShareUsingTheSharingApi(
$response = $this->deletePublicLinkShareUsingTheSharingApi(
$user,
$name,
$path
);
$this->theHTTPStatusCodeShouldBeSuccess();
$this->theHTTPStatusCodeShouldBeBetween(200, 299, $response);
}

/**
Expand Down Expand Up @@ -3144,11 +3147,12 @@ public function userReactsToShareOfferedBy(string $user, string $action, string
$httpRequestMethod = "POST";
}

$this->ocsContext->userSendsHTTPMethodToOcsApiEndpointWithBody(
$response = $this->ocsContext->userSendsHTTPMethodToOcsApiEndpointWithBody(
$user,
$httpRequestMethod,
$url
);
$this->setResponse($response);
$this->pushToLastStatusCodesArrays();
}

Expand Down Expand Up @@ -3202,11 +3206,12 @@ public function userReactsToShareWithShareIDOfferedBy(string $user, string $acti
$httpRequestMethod = "POST";
}

$this->ocsContext->userSendsHTTPMethodToOcsApiEndpointWithBody(
$response = $this->ocsContext->userSendsHTTPMethodToOcsApiEndpointWithBody(
$user,
$httpRequestMethod,
$url
);
$this->setResponse($response);
}

/**
Expand Down Expand Up @@ -3394,11 +3399,12 @@ public function userUnsharesResourceSharedTo(string $sharer, string $path, strin
__METHOD__ . " could not find share, offered by $sharer to $sharee"
);

$this->ocsContext->userSendsHTTPMethodToOcsApiEndpointWithBody(
$response = $this->ocsContext->userSendsHTTPMethodToOcsApiEndpointWithBody(
$sharer,
'DELETE',
'/apps/files_sharing/api/v' . $this->sharingApiVersion . '/shares/' . $shareId
);
$this->setResponse($response);
}

/**
Expand Down

0 comments on commit 567ae26

Please sign in to comment.