Skip to content

Commit

Permalink
Added acceptance test for user:sync with non-existing user
Browse files Browse the repository at this point in the history
  • Loading branch information
kiranparajuli589 committed Feb 17, 2020
1 parent de43967 commit fbdab0f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ public function ldapConfigHasTheseSettings($configId, TableNode $table) {
* @return void
*/
public function ldapUserIsSynced($user) {
$occResult = SetupHelper::runOcc(
$this->featureContext->runOcc(
['user:sync', 'OCA\User_LDAP\User_Proxy', '-u', $user, '-m', 'remove']
);
if ($occResult['code'] !== "0") {
if ($this->featureContext->getExitStatusCodeOfOccCommand() !== 0) {
throw new \Exception("could not sync LDAP user {$user} " . $occResult['stdErr']);
}
}
Expand Down
12 changes: 12 additions & 0 deletions tests/acceptance/features/cliProvisioning/userSync.feature
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,15 @@ Feature: sync user using occ command
And user "regularuser" should exist
And the display name of user "regularuser" should be "Test User"
And the display name of user "regular" should be "Regular User"

@issue-515
Scenario: sync a user that does not exist
Given user "regularuser" should not exist
When LDAP user "regularuser" is resynced
Then the command should have been successful
And the command output should be:
"""
Syncing regularuser ...
Deleting accounts:
regularuser, , (no longer exists in the backend)
"""

0 comments on commit fbdab0f

Please sign in to comment.