Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Occ test cli provisioning get user groups #33129

Merged
merged 2 commits into from
Oct 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions tests/acceptance/features/bootstrap/OccContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,19 @@ public function theAdministratorRetrievesTheInformationOfUserUsingTheOccCommand(
);
}

/**
* @When the administrator gets the groups of user :username using the occ command
*
* @param string $username
*
* @return void
*/
public function theAdministratorGetsTheGroupsOfUserUsingTheOccCommand($username) {
$this->featureContext->invokingTheCommand(
"user:list-group $username --output=json"
);
}

/**
* @When the administrator sends a group creation request for group :group using the occ command
*
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/features/cliProvisioning/getUser.feature
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ Feature: get user
Given user "not-a-user" has been deleted
When the administrator retrieves the information of user "not-a-user" using the occ command
Then the command should have been successful
And the occ command JSON output should be empty
And the occ command JSON output should be empty
35 changes: 35 additions & 0 deletions tests/acceptance/features/cliProvisioning/getUserGroups.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@cli @skipOnLDAP
Feature: get user groups
As an admin
I want to be able to get groups
So that I can manage group membership

Scenario: admin gets groups of an user
Given user "brand-new-user" has been created
And group "unused-group" has been created
And group "new-group" has been created
And group "0" has been created
And group "Admin & Finance (NP)" has been created
And group "admin:Pokhara@Nepal" has been created
And group "नेपाली" has been created
And user "brand-new-user" has been added to group "new-group"
And user "brand-new-user" has been added to group "0"
And user "brand-new-user" has been added to group "Admin & Finance (NP)"
And user "brand-new-user" has been added to group "admin:Pokhara@Nepal"
And user "brand-new-user" has been added to group "नेपाली"
When the administrator gets the groups of user "brand-new-user" using the occ command
Then the command should have been successful
And the groups returned by the occ command should be
| group |
| new-group |
| 0 |
| Admin & Finance (NP) |
| admin:Pokhara@Nepal |
| नेपाली |

Scenario: admin gets groups of an user who is not in any groups
Given user "brand-new-user" has been created
And group "unused-group" has been created
When the administrator gets the groups of user "brand-new-user" using the occ command
Then the command should have been successful
And the occ command JSON output should be empty