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 edit user #33094

Merged
merged 2 commits into from
Oct 9, 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
55 changes: 55 additions & 0 deletions tests/acceptance/features/bootstrap/OccContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,48 @@ public function resetUserPasswordUsingTheOccCommand($username, $password) {
);
}

/**
* @When the administrator changes the email of user :username to :newEmail using the occ command
*
* @param string $username
* @param string $newEmail
*
* @return void
*/
public function theAdministratorChangesTheEmailOfUserToUsingTheOccCommand($username, $newEmail) {
$this->featureContext->invokingTheCommand(
"user:modify $username email $newEmail"
);
}

/**
* @When the administrator changes the display name of user :username to :newDisplayname using the occ command
*
* @param string $username
* @param string $newDisplayname
*
* @return void
*/
public function theAdministratorChangesTheDisplayNameOfUserToUsingTheOccCommand($username, $newDisplayname) {
$this->featureContext->invokingTheCommand(
"user:modify $username displayname '$newDisplayname'"
);
}

/**
* @When the administrator changes the quota of user :username to :newQuota using the occ command
*
* @param string $username
* @param string $newQuota
*
* @return void
*/
public function theAdministratorChangesTheQuotaOfUserToUsingTheOccCommand($username, $newQuota) {
$this->featureContext->invokingTheCommand(
"user:modify $username quota $newQuota"
);
}

/**
* @When the administrator sends a user deletion request for user :username using the occ command
*
Expand Down Expand Up @@ -213,6 +255,19 @@ public function theAdministratorDisablesTheAppUsingTheOccCommand($appName) {
);
}

/**
* @When the administrator disables the user :username using the occ command
*
* @param string $username
*
* @return void
*/
public function theAdministratorDisablesTheUserUsingTheOccCommand($username) {
$this->featureContext->invokingTheCommand(
"user:disable $username"
);
}

/**
* This will run before EVERY scenario.
* It will set the properties for this object.
Expand Down
31 changes: 31 additions & 0 deletions tests/acceptance/features/cliProvisioning/disableUser.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@cli @skipOnLDAP
Feature: disable user
As an admin
I want to be able to disable a user
So that I can remove access to files and resources for a user, without actually deleting the files and resources

Scenario: admin disables an user
Given user "user1" has been created
When the administrator disables the user "user1" using the occ command
Then the command should have been successful
And the command output should contain the text 'The specified user is disabled'
And user "user1" should be disabled

Scenario: Admin can disable another admin user
Given user "another-admin" has been created
And user "another-admin" has been added to group "admin"
When the administrator disables the user "another-admin" using the occ command
Then the command should have been successful
And the command output should contain the text 'The specified user is disabled'
And user "another-admin" should be disabled

Scenario: Admin can disable subadmins in the same group
Given user "subadmin" has been created
And group "new-group" has been created
And user "subadmin" has been added to group "new-group"
And user "%admin%" has been added to group "new-group"
And user "subadmin" has been made a subadmin of group "new-group"
When the administrator disables the user "subadmin" using the occ command
Then the command should have been successful
And the command output should contain the text 'The specified user is disabled'
And user "subadmin" should be disabled
33 changes: 33 additions & 0 deletions tests/acceptance/features/cliProvisioning/editUser.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@cli @skipOnLDAP
Feature: edit users
As an admin, subadmin or as myself
I want to be able to edit user information
So that I can keep the user information up-to-date

Scenario: the administrator can edit a user email
Given user "brand-new-user" has been created
When the administrator changes the email of user "brand-new-user" to "[email protected]" using the occ command
Then the command should have been successful
And the command output should contain the text 'The email address of brand-new-user updated to [email protected]'
And user "brand-new-user" should exist
And the user attributes returned by the API should include
| email | [email protected] |

Scenario: the administrator can edit a user display name
Given user "brand-new-user" has been created
When the administrator changes the display name of user "brand-new-user" to "A New User" using the occ command
Then the command should have been successful
And the command output should contain the text 'The displayname of brand-new-user updated to A New User'
And user "brand-new-user" should exist
And the user attributes returned by the API should include
| displayname | A New User |

@skip @issue-33093
Scenario: the administrator can edit a user quota
Given user "brand-new-user" has been created
When the administrator changes the quota of user "brand-new-user" to "12MB" using the occ command
Then the command should have been successful
And the command output should contain the text 'The quota of brand-new-user updated to 12 MB'
And user "brand-new-user" should exist
And the user attributes returned by the API should include
| quota definition | 12 MB |