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 delete user #33081

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
27 changes: 27 additions & 0 deletions tests/acceptance/features/bootstrap/OccContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ public function theAdministratorSendsAUserCreationRequestForUserPasswordGroupUsi
'OC_PASS',
$this->featureContext->getActualPassword($password)
);
$this->featureContext->addUserToCreatedUsersList($username, $password);
}

/**
Expand All @@ -145,6 +146,19 @@ public function resetUserPasswordUsingTheOccCommand($username, $password) {
);
}

/**
* @When the administrator sends a user deletion request for user :username using the occ command
*
* @param string $username
*
* @return void
*/
public function theAdministratorSendsAUserDeletionRequestForUserUsingTheOccCommand($username) {
$this->featureContext->invokingTheCommand(
"user:delete $username"
);
}

/**
* @When the administrator sends a group creation request for group :group using the occ command
*
Expand Down Expand Up @@ -173,6 +187,19 @@ public function theAdministratorAddsTheUserToTheGroupUsingTheOccCommand($usernam
);
}

/**
* @When the administrator deletes group :group using the occ command
*
* @param string $group
*
* @return void
*/
public function theAdministratorDeletesGroupUsingTheOccCommand($group) {
$this->featureContext->invokingTheCommand(
"group:delete $group"
);
}

/**
* This will run before EVERY scenario.
* It will set the properties for this object.
Expand Down
17 changes: 17 additions & 0 deletions tests/acceptance/features/cliProvisioning/deleteGroup.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@cli @skipOnLDAP
Feature: delete groups
As an admin
I want to be able to delete groups
So that I can remove unnecessary groups

Scenario Outline: admin deletes a group
Given group "<group_id>" has been created
When the administrator deletes group "<group_id>" using the occ command
Then the command should have been successful
And the command output should contain the text 'The specified group was deleted'
And group "<group_id>" should not exist
Examples:
| group_id | comment |
| simplegroup | nothing special here |
| España | special European characters |
| नेपाली | Unicode group name |
19 changes: 19 additions & 0 deletions tests/acceptance/features/cliProvisioning/deleteUser.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@cli @skipOnLDAP
Feature: delete users
As an admin
I want to be able to delete users
So that I can remove user from ownCloud

Scenario: admin deletes a user
Given user "brand-new-user" has been created
When the administrator sends a user deletion request for user "brand-new-user" using the occ command
Then the command should have been successful
And the command output should contain the text "User with uid 'brand-new-user', display name 'brand-new-user', email '' was deleted"
And user "brand-new-user" should not exist

Scenario: admin tries to delete a non-existing user
Given user "brand-new-user" has been deleted
When the administrator sends a user deletion request for user "brand-new-user" using the occ command
Then the command should have failed with exit code 1
And the command output should contain the text "User with uid 'brand-new-user' does not exist"
And user "brand-new-user" should not exist