@@ -63,7 +63,7 @@ public function getRoles(string $user): ResponseInterface {
6363 }
6464
6565 /**
66- * @When /^user "([^"]*)" tries to get all existing roles$/
66+ * @When /^user "([^"]*)" tries to get all existing roles using the settings API $/
6767 *
6868 * @param string $user
6969 *
@@ -139,6 +139,30 @@ public function theAdministratorHasGivenUserTheRole(string $user, string $role):
139139 );
140140 }
141141
142+ /**
143+ * @When user :assigner assigns the role :role to user :assignee using the settings API
144+ *
145+ * @param string $assigner
146+ * @param string $role
147+ * @param string $assignee
148+ *
149+ * @return void
150+ *
151+ * @throws Exception
152+ */
153+ public function userAssignsTheRoleToUserUsingTheSettingsApi (
154+ string $ assigner ,
155+ string $ role ,
156+ string $ assignee
157+ ): void {
158+ $ response = $ this ->assignRoleToUser (
159+ $ assigner ,
160+ $ this ->featureContext ->getAttributeOfCreatedUser ($ assignee , 'id ' ),
161+ $ this ->getRoleIdByRoleName ($ assigner , $ role )
162+ );
163+ $ this ->featureContext ->setResponse ($ response );
164+ }
165+
142166 /**
143167 * @param string $user
144168 * @param string $role
@@ -232,7 +256,7 @@ public function userChangeRoleAnotherUser(string $user, string $role, string $as
232256 }
233257
234258 /**
235- * @When /^user "([^"]*)" tries to get list of assignment$/
259+ * @When /^user "([^"]*)" tries to get list of assignment using the settings API $/
236260 *
237261 * @param string $user
238262 *
@@ -444,6 +468,22 @@ public function theUserHasSwitchedSystemLanguage(string $user, string $language)
444468 );
445469 }
446470
471+ /**
472+ * @When user :user switches the system language to :language using the settings API
473+ *
474+ * @param string $user
475+ * @param string $language
476+ *
477+ * @return void
478+ *
479+ * @throws Exception
480+ * @throws GuzzleException
481+ */
482+ public function userSwitchesTheSystemLanguageUsingTheSettingsApi (string $ user , string $ language ): void {
483+ $ response = $ this ->sendRequestToSwitchSystemLanguage ($ user , $ language );
484+ $ this ->featureContext ->setResponse ($ response );
485+ }
486+
447487 /**
448488 * @param string $user
449489 *
@@ -497,4 +537,20 @@ public function theUserHasDisabledAutoAccepting(string $user): void {
497537 );
498538 $ this ->featureContext ->rememberUserAutoSyncSetting ($ user , false );
499539 }
540+
541+ /**
542+ * @When user :user disables the auto-sync share using the settings API
543+ *
544+ * @param string $user
545+ *
546+ * @return void
547+ *
548+ * @throws Exception
549+ * @throws GuzzleException
550+ */
551+ public function userDisablesAutoAcceptingUsingSettingsApi (string $ user ): void {
552+ $ response = $ this ->sendRequestToDisableAutoAccepting ($ user );
553+ $ this ->featureContext ->setResponse ($ response );
554+ $ this ->featureContext ->rememberUserAutoSyncSetting ($ user , false );
555+ }
500556}
0 commit comments