diff --git a/tests/acceptance/features/bootstrap/OccContext.php b/tests/acceptance/features/bootstrap/OccContext.php index 8485b93d79ba..6b0de1a5ddbd 100644 --- a/tests/acceptance/features/bootstrap/OccContext.php +++ b/tests/acceptance/features/bootstrap/OccContext.php @@ -303,6 +303,20 @@ public function theAdministratorGetsTheGroupsUsingTheOccCommand() { ); } + /** + * @When the administrator removes user :username from group :group using the occ command + * + * @param string $username + * @param string $group + * + * @return void + */ + public function theAdministratorRemovesUserFromGroupUsingTheOccCommand($username, $group) { + $this->featureContext->invokingTheCommand( + "group:remove-member -m $username $group" + ); + } + /** * @When the administrator disables the app :appName using the occ command * diff --git a/tests/acceptance/features/cliProvisioning/removeFromGroup.feature b/tests/acceptance/features/cliProvisioning/removeFromGroup.feature new file mode 100644 index 000000000000..f82a5c0f5db1 --- /dev/null +++ b/tests/acceptance/features/cliProvisioning/removeFromGroup.feature @@ -0,0 +1,26 @@ +@cli @skipOnLDAP +Feature: remove a user from a group + As an admin + I want to be able to remove a user from a group + So that I can manage user access to group resources + + Scenario Outline: admin removes a user from a group + Given user "brand-new-user" has been created + And group "" has been created + And user "brand-new-user" has been added to group "" + When the administrator removes user "brand-new-user" from group "" using the occ command + Then the command should have been successful + And the command output should contain the text 'Member "brand-new-user" removed from group ""' + And user "brand-new-user" should not belong to group "" + Examples: + | group_id | comment | + | simplegroup | nothing special here | + | España | special European characters | + | नेपाली | Unicode group name | + + Scenario: admin tries to remove a user from a group which does not exist + Given user "brand-new-user" has been created + And group "not-group" has been deleted + When the administrator removes user "brand-new-user" from group "not-group" using the occ command + Then the command should have failed with exit code 1 + And the command output should contain the text 'Group "not-group" does not exist' \ No newline at end of file