3535class FederationContext implements Context, SnippetAcceptingContext {
3636
3737 use WebDav;
38+ use AppConfiguration;
3839
3940 /**
4041 * @Given /^User "([^"]*)" from server "(LOCAL|REMOTE)" shares "([^"]*)" with user "([^"]*)" from server "(LOCAL|REMOTE)"$/
@@ -56,6 +57,27 @@ public function federateSharing($sharerUser, $sharerServer, $sharerPath, $sharee
5657 $ this ->usingServer ($ previous );
5758 }
5859
60+
61+ /**
62+ * @Given /^User "([^"]*)" from server "(LOCAL|REMOTE)" shares "([^"]*)" with group "([^"]*)" from server "(LOCAL|REMOTE)"$/
63+ *
64+ * @param string $sharerUser
65+ * @param string $sharerServer "LOCAL" or "REMOTE"
66+ * @param string $sharerPath
67+ * @param string $shareeUser
68+ * @param string $shareeServer "LOCAL" or "REMOTE"
69+ */
70+ public function federateGroupSharing ($ sharerUser , $ sharerServer , $ sharerPath , $ shareeGroup , $ shareeServer ){
71+ if ($ shareeServer == "REMOTE " ){
72+ $ shareWith = "$ shareeGroup@ " . substr ($ this ->remoteBaseUrl , 0 , -4 );
73+ } else {
74+ $ shareWith = "$ shareeGroup@ " . substr ($ this ->localBaseUrl , 0 , -4 );
75+ }
76+ $ previous = $ this ->usingServer ($ sharerServer );
77+ $ this ->createShare ($ sharerUser , $ sharerPath , 9 , $ shareWith , null , null , null );
78+ $ this ->usingServer ($ previous );
79+ }
80+
5981 /**
6082 * @When /^User "([^"]*)" from server "(LOCAL|REMOTE)" accepts last pending share$/
6183 * @param string $user
@@ -73,4 +95,9 @@ public function acceptLastPendingShare($user, $server){
7395 $ this ->theOCSStatusCodeShouldBe ('100 ' );
7496 $ this ->usingServer ($ previous );
7597 }
98+
99+ protected function resetAppConfigs () {
100+ $ this ->modifyServerConfig ('files_sharing ' , 'incoming_server2server_group_share_enabled ' , 'no ' );
101+ $ this ->modifyServerConfig ('files_sharing ' , 'outgoing_server2server_group_share_enabled ' , 'no ' );
102+ }
76103}
0 commit comments