From 567ae2627b5194b40b03c8472837a832c502d7b5 Mon Sep 17 00:00:00 2001 From: KarunAtreya Date: Tue, 26 Sep 2023 16:05:41 +0545 Subject: [PATCH] made changes to the affected test steps --- .../features/bootstrap/ShareesContext.php | 3 +- .../acceptance/features/bootstrap/Sharing.php | 28 +++++++++++-------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/tests/acceptance/features/bootstrap/ShareesContext.php b/tests/acceptance/features/bootstrap/ShareesContext.php index 2fc8cbf146a..25c31bfb9b1 100644 --- a/tests/acceptance/features/bootstrap/ShareesContext.php +++ b/tests/acceptance/features/bootstrap/ShareesContext.php @@ -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); } /** diff --git a/tests/acceptance/features/bootstrap/Sharing.php b/tests/acceptance/features/bootstrap/Sharing.php index 440d1ef0cf5..70b0633fcf4 100644 --- a/tests/acceptance/features/bootstrap/Sharing.php +++ b/tests/acceptance/features/bootstrap/Sharing.php @@ -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); } /** @@ -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); } /** @@ -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 @@ -3060,11 +3062,12 @@ public function userDeletesPublicLinkShareNamedUsingTheSharingApi( string $name, string $path ):void { - $this->deletePublicLinkShareUsingTheSharingApi( + $response = $this->deletePublicLinkShareUsingTheSharingApi( $user, $name, $path ); + $this->setResponse($response); } /** @@ -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); } /** @@ -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(); } @@ -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); } /** @@ -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); } /**