From 0c09f566c24e45b3d4dc91dc2bddc341e4f76fbd Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Thu, 5 Jul 2018 13:51:34 +0200 Subject: add some integration tests Signed-off-by: Bjoern Schiessle --- .../features/bootstrap/FederationContext.php | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'build/integration/features') diff --git a/build/integration/features/bootstrap/FederationContext.php b/build/integration/features/bootstrap/FederationContext.php index f3eb004fb84..12bf9c0fe63 100644 --- a/build/integration/features/bootstrap/FederationContext.php +++ b/build/integration/features/bootstrap/FederationContext.php @@ -35,6 +35,7 @@ require __DIR__ . '/../../vendor/autoload.php'; class FederationContext implements Context, SnippetAcceptingContext { use WebDav; + use AppConfiguration; /** * @Given /^User "([^"]*)" from server "(LOCAL|REMOTE)" shares "([^"]*)" with user "([^"]*)" from server "(LOCAL|REMOTE)"$/ @@ -56,6 +57,27 @@ class FederationContext implements Context, SnippetAcceptingContext { $this->usingServer($previous); } + + /** + * @Given /^User "([^"]*)" from server "(LOCAL|REMOTE)" shares "([^"]*)" with group "([^"]*)" from server "(LOCAL|REMOTE)"$/ + * + * @param string $sharerUser + * @param string $sharerServer "LOCAL" or "REMOTE" + * @param string $sharerPath + * @param string $shareeUser + * @param string $shareeServer "LOCAL" or "REMOTE" + */ + public function federateGroupSharing($sharerUser, $sharerServer, $sharerPath, $shareeGroup, $shareeServer){ + if ($shareeServer == "REMOTE"){ + $shareWith = "$shareeGroup@" . substr($this->remoteBaseUrl, 0, -4); + } else { + $shareWith = "$shareeGroup@" . substr($this->localBaseUrl, 0, -4); + } + $previous = $this->usingServer($sharerServer); + $this->createShare($sharerUser, $sharerPath, 9, $shareWith, null, null, null); + $this->usingServer($previous); + } + /** * @When /^User "([^"]*)" from server "(LOCAL|REMOTE)" accepts last pending share$/ * @param string $user @@ -73,4 +95,9 @@ class FederationContext implements Context, SnippetAcceptingContext { $this->theOCSStatusCodeShouldBe('100'); $this->usingServer($previous); } + + protected function resetAppConfigs() { + $this->modifyServerConfig('files_sharing', 'incoming_server2server_group_share_enabled', 'no'); + $this->modifyServerConfig('files_sharing', 'outgoing_server2server_group_share_enabled', 'no'); + } } -- cgit v1.2.3