Skip to content

Commit 9313f5c

Browse files
committed
Add tests for getUsers
1 parent 96a24ea commit 9313f5c

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

tests/acceptance/features/bootstrap/OccContext.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,20 @@ public function theAdministratorGetsTheGroupsUsingTheOccCommand() {
303303
);
304304
}
305305

306+
/**
307+
* @When the administrator removes user :username from group :group using the occ command
308+
*
309+
* @param string $username
310+
* @param string $group
311+
*
312+
* @return void
313+
*/
314+
public function theAdministratorRemovesUserFromGroupUsingTheOccCommand($username, $group) {
315+
$this->featureContext->invokingTheCommand(
316+
"group:remove-member -m $username $group"
317+
);
318+
}
319+
306320
/**
307321
* @When the administrator disables the app :appName using the occ command
308322
*
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
@cli @skipOnLDAP
2+
Feature: remove a user from a group
3+
As an admin
4+
I want to be able to remove a user from a group
5+
So that I can manage user access to group resources
6+
7+
Scenario Outline: admin removes a user from a group
8+
Given user "brand-new-user" has been created
9+
And group "<group_id>" has been created
10+
And user "brand-new-user" has been added to group "<group_id>"
11+
When the administrator removes user "brand-new-user" from group "<group_id>" using the occ command
12+
Then the command should have been successful
13+
And the command output should contain the text 'Member "brand-new-user" removed from group "<group_id>"'
14+
And user "brand-new-user" should not belong to group "<group_id>"
15+
Examples:
16+
| group_id | comment |
17+
| simplegroup | nothing special here |
18+
| España | special European characters |
19+
| नेपाली | Unicode group name |
20+
21+
Scenario: admin tries to remove a user from a group which does not exist
22+
Given user "brand-new-user" has been created
23+
And group "not-group" has been deleted
24+
When the administrator removes user "brand-new-user" from group "not-group" using the occ command
25+
Then the command should have failed with exit code 1
26+
And the command output should contain the text 'Group "not-group" does not exist'

0 commit comments

Comments
 (0)