Skip to content

Commit

Permalink
Merge pull request #33129 from owncloud/occTest-cliProvisioning-getUs…
Browse files Browse the repository at this point in the history
…erGroups

Occ test cli provisioning get user groups
  • Loading branch information
phil-davis authored Oct 10, 2018
2 parents 2ca5688 + 8d0ef20 commit 8537019
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
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

0 comments on commit 8537019

Please sign in to comment.