From d058278f442a0f4e40dd7cb6db2df838f5ff3630 Mon Sep 17 00:00:00 2001 From: Swikriti Tripathi Date: Thu, 15 Dec 2022 16:18:18 +0545 Subject: [PATCH] fex style --- ...ected-failures-localAPI-on-OCIS-storage.md | 2 +- .../features/bootstrap/SpacesContext.php | 53 ++++++++----------- 2 files changed, 24 insertions(+), 31 deletions(-) diff --git a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md index e1ed48cff..8cffa1a10 100644 --- a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md @@ -80,7 +80,7 @@ The expected failures in this file are from features in the owncloud/ocis repo. - [apiCors/cors.feature:68](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiCors/cors.feature#L68) #### [Public cannot download folder via the public link of the folder inside the project space](https://github.com/owncloud/ocis/issues/5229) -- [apiSpacesShares/publicLinkDownload.feature:31](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/publicLinkDownload.feature#L31) +- [apiSpacesShares/publicLinkDownload.feature:30](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/publicLinkDownload.feature#L30) #### [A User can get information of another user with Graph API](https://github.com/owncloud/ocis/issues/5125) - [apiGraph/getUser.feature:23](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/getUser.feature#L23) diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index fbe4cd44f..0c715e1b5 100644 --- a/tests/acceptance/features/bootstrap/SpacesContext.php +++ b/tests/acceptance/features/bootstrap/SpacesContext.php @@ -74,11 +74,6 @@ class SpacesContext implements Context { */ private FilesVersionsContext $filesVersionsContext; - /** - * @var ArchiverContext - */ - private ArchiverContext $archiverContext; - /** * @var string */ @@ -463,7 +458,6 @@ class SpacesContext implements Context { $this->favoritesContext = $environment->getContext('FavoritesContext'); $this->checksumContext = $environment->getContext('ChecksumContext'); $this->filesVersionsContext = $environment->getContext('FilesVersionsContext'); - $this->archiverContext = $environment->getContext('ArchiverContext'); // Run the BeforeScenario function in OCSContext to set it up correctly $this->ocsContext->before($scope); $this->baseUrl = \trim($this->featureContext->getBaseUrl(), "/"); @@ -3096,28 +3090,27 @@ class SpacesContext implements Context { } } - /** - * @When /^public downloads the folder "([^"]*)" of space "([^"]*)" from the last created public link of "([^"]*)" using the resource id$/ - * @param string $resource - * @param string $space - * @param string $owner - * - * @return void - * @throws GuzzleException - */ - public function publicDownloadsTheFolderFromTheLastCreatedPublicLink(string $resource, string $space, string $owner) - { - $token = $this->featureContext->getLastPublicShareToken(); - $resourceId = $this->getFolderId($owner, $space, $resource); - $queryString = 'public-token='.$token.'&id='.$resourceId; - $this->featureContext->setResponse( - HttpRequestHelper::get( - $this->featureContext->getBaseUrl() . '/archiver?' . $queryString, - '', - '', - '', - ) - ); - } - + /** + * @When /^public downloads the folder "([^"]*)" of space "([^"]*)" from the last created public link of "([^"]*)" using the resource id$/ + * + * @param string $resource + * @param string $space + * @param string $owner + * + * @return void + * @throws GuzzleException + */ + public function publicDownloadsTheFolderFromTheLastCreatedPublicLink(string $resource, string $space, string $owner) { + $token = $this->featureContext->getLastPublicShareToken(); + $resourceId = $this->getFolderId($owner, $space, $resource); + $queryString = 'public-token=' . $token . '&id=' . $resourceId; + $this->featureContext->setResponse( + HttpRequestHelper::get( + $this->featureContext->getBaseUrl() . '/archiver?' . $queryString, + '', + '', + '', + ) + ); + } }