From 87179595406d12055c1ad2ebdbc248ed5c29ea1f Mon Sep 17 00:00:00 2001 From: Prarup Gurung Date: Fri, 17 May 2024 15:34:13 +0545 Subject: [PATCH] propfind.feature: Used sharingNG for sharing in given step --- tests/acceptance/config/behat-core.yml | 1 - .../bootstrap/PublicWebDavContext.php | 2 +- .../coreApiWebdavOperations/propfind.feature | 30 +++++++++++-------- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/tests/acceptance/config/behat-core.yml b/tests/acceptance/config/behat-core.yml index 696f4b037..25bd0f6c1 100644 --- a/tests/acceptance/config/behat-core.yml +++ b/tests/acceptance/config/behat-core.yml @@ -253,7 +253,6 @@ default: - FeatureContext: *common_feature_context_params - SearchContext: - PublicWebDavContext: - - SpacesContext: - SharingNgContext: - WebDavPropertiesContext: - TrashbinContext: diff --git a/tests/acceptance/features/bootstrap/PublicWebDavContext.php b/tests/acceptance/features/bootstrap/PublicWebDavContext.php index 1a2c4e1af..199b4caf6 100644 --- a/tests/acceptance/features/bootstrap/PublicWebDavContext.php +++ b/tests/acceptance/features/bootstrap/PublicWebDavContext.php @@ -1871,7 +1871,7 @@ class PublicWebDavContext implements Context { } else { $body = null; } - $token = $this->featureContext->getLastCreatedPublicShareToken(); + $token = ($this->featureContext->isUsingSharingNG()) ? $this->featureContext->shareNgGetLastCreatedLinkShareToken() : $this->featureContext->getLastCreatedPublicShareToken(); $davPath = WebDavHelper::getDavPath( null, null, diff --git a/tests/acceptance/features/coreApiWebdavOperations/propfind.feature b/tests/acceptance/features/coreApiWebdavOperations/propfind.feature index 9fae2789e..7c8aa28de 100644 --- a/tests/acceptance/features/coreApiWebdavOperations/propfind.feature +++ b/tests/acceptance/features/coreApiWebdavOperations/propfind.feature @@ -48,10 +48,12 @@ Feature: PROPFIND Scenario: send PROPFIND request to a public link shared with password Given user "Alice" has been created with default attributes and without skeleton files And user "Alice" has created folder "/PARENT" - And user "Alice" has created a public link share with settings - | path | /PARENT | - | permissions | read | - | password | %public% | + And using SharingNG + And user "Alice" has created the following resource link share: + | resource | PARENT | + | space | Personal | + | permissionsRole | view | + | password | %public% | When the public sends "PROPFIND" request to the last public link share using the new public WebDAV API with password "%public%" Then the HTTP status code should be "207" And the value of the item "//d:href" in the response should match "/%base_path%\/remote.php\/dav\/public-files\/%public_token%\/$/" @@ -61,10 +63,12 @@ Feature: PROPFIND Scenario: send PROPFIND request to a public link shared with password (request without password) Given user "Alice" has been created with default attributes and without skeleton files And user "Alice" has created folder "/PARENT" - And user "Alice" has created a public link share with settings - | path | /PARENT | - | permissions | read | - | password | %public% | + And using SharingNG + And user "Alice" has created the following resource link share: + | resource | PARENT | + | space | Personal | + | permissionsRole | view | + | password | %public% | When the public sends "PROPFIND" request to the last public link share using the new public WebDAV API Then the HTTP status code should be "401" And the value of the item "/d:error/s:exception" in the response should be "Sabre\DAV\Exception\NotAuthenticated" @@ -73,10 +77,12 @@ Feature: PROPFIND Scenario: send PROPFIND request to a public link shared with password (request with incorrect password) Given user "Alice" has been created with default attributes and without skeleton files And user "Alice" has created folder "/PARENT" - And user "Alice" has created a public link share with settings - | path | /PARENT | - | permissions | read | - | password | %public% | + And using SharingNG + And user "Alice" has created the following resource link share: + | resource | PARENT | + | space | Personal | + | permissionsRole | view | + | password | %public% | When the public sends "PROPFIND" request to the last public link share using the new public WebDAV API with password "1234" Then the HTTP status code should be "401" And the value of the item "/d:error/s:exception" in the response should be "Sabre\DAV\Exception\NotAuthenticated"