Skip to content

Commit

Permalink
Merge pull request #33081 from owncloud/occTest-cliProvisioning-delet…
Browse files Browse the repository at this point in the history
…eUser

Occ test cli provisioning delete user
  • Loading branch information
paurakhsharma authored Oct 9, 2018
2 parents a16d7bf + 3848e71 commit 9c67a6a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
14 changes: 14 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
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

0 comments on commit 9c67a6a

Please sign in to comment.