From caba30bdb3d269d1b3dfb12da7ada09333ea726b Mon Sep 17 00:00:00 2001 From: Prarup Gurung Date: Wed, 15 May 2024 17:37:54 +0545 Subject: [PATCH] used token from last shareng public link for test using shareng --- tests/acceptance/config/behat-core.yml | 4 ++-- tests/acceptance/features/bootstrap/WebDav.php | 8 ++------ .../features/bootstrap/WebDavPropertiesContext.php | 7 ++++--- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/tests/acceptance/config/behat-core.yml b/tests/acceptance/config/behat-core.yml index 6a151d1d2..9290eb362 100644 --- a/tests/acceptance/config/behat-core.yml +++ b/tests/acceptance/config/behat-core.yml @@ -134,10 +134,10 @@ default: - FeatureContext: *common_feature_context_params - PublicWebDavContext: - TrashbinContext: - - WebDavPropertiesContext: - - OcisConfigContext: - SpacesContext: - SharingNgContext: + - WebDavPropertiesContext: + - OcisConfigContext: coreApiSharePublicLink2: paths: diff --git a/tests/acceptance/features/bootstrap/WebDav.php b/tests/acceptance/features/bootstrap/WebDav.php index 8d1450975..f7455c534 100644 --- a/tests/acceptance/features/bootstrap/WebDav.php +++ b/tests/acceptance/features/bootstrap/WebDav.php @@ -5505,13 +5505,9 @@ trait WebDav { * @throws Exception */ public function thePublicListsTheResourcesInTheLastCreatedPublicLinkWithDepthUsingTheWebdavApi(string $depth):void { - if ($this->isUsingSharingNG()) { - $user = $this->shareNgGetLastCreatedLinkShareToken(); - } else { - $user = $this->getLastCreatedPublicShareToken(); - } + $token = ($this->isUsingSharingNG()) ? $this->shareNgGetLastCreatedLinkShareToken() : $this->getLastCreatedPublicShareToken(); $response = $this->listFolder( - $user, + $token, '/', $depth, null, diff --git a/tests/acceptance/features/bootstrap/WebDavPropertiesContext.php b/tests/acceptance/features/bootstrap/WebDavPropertiesContext.php index 8e550ee9d..fc05fd8ca 100644 --- a/tests/acceptance/features/bootstrap/WebDavPropertiesContext.php +++ b/tests/acceptance/features/bootstrap/WebDavPropertiesContext.php @@ -227,13 +227,13 @@ class WebDavPropertiesContext implements Context { * @throws Exception */ public function getPropertiesOfEntryFromLastLinkShare(string $path, TableNode $propertiesTable): ResponseInterface { - $user = $this->featureContext->getLastCreatedPublicShareToken(); + $token = ($this->featureContext->isUsingSharingNG()) ? $this->featureContext->shareNgGetLastCreatedLinkShareToken() : $this->featureContext->getLastCreatedPublicShareToken(); $properties = null; foreach ($propertiesTable->getRows() as $row) { $properties[] = $row[0]; } return $this->featureContext->listFolder( - $user, + $token, $path, '0', $properties, @@ -824,6 +824,7 @@ class WebDavPropertiesContext implements Context { ); $user = $this->featureContext->getActualUsername($user); $value = $xmlPart[0]->__toString(); + $callback = ($this->featureContext->isUsingSharingNG()) ? "shareNgGetLastCreatedLinkShareToken" : "getLastCreatedPublicShareToken"; $pattern = $this->featureContext->substituteInLineCodes( $pattern, $user, @@ -832,7 +833,7 @@ class WebDavPropertiesContext implements Context { [ "code" => "%public_token%", "function" => - [$this->featureContext, "getLastCreatedPublicShareToken"], + [$this->featureContext, $callback], "parameter" => [] ], ]