Skip to content

Commit

Permalink
Removed unused variable from exception message
Browse files Browse the repository at this point in the history
  • Loading branch information
kiranparajuli589 authored and phil-davis committed May 25, 2020
1 parent eac4d03 commit 45468de
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tests/acceptance/features/bootstrap/UserLdapGeneralContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@ public function ldapUserIsSynced($user) {
['user:sync', 'OCA\User_LDAP\User_Proxy', '-u', $user, '-m', 'remove']
);
if ($this->featureContext->getExitStatusCodeOfOccCommand() !== 0) {
throw new \Exception("could not sync LDAP user {$user} " . $occResult['stdErr']);
throw new \Exception(
"could not sync LDAP user {$user} " .
$this->featureContext->getStdErrOfOccCommand()
);
}
}

Expand All @@ -148,7 +151,7 @@ public function ldapUserIsSynced($user) {
public function theAdminListsTheEnabledBackendsUsingTheOccCommand() {
$this->featureContext->runOcc(["user:sync -l"]);
}

/**
* @When the administrator sets the ldap attribute :attribute of the entry :entry to :value
*
Expand Down Expand Up @@ -209,7 +212,7 @@ public function theLdapAttributeOfTheEntryToContentOfFile(
$attribute, $entry, $filename
) {
$value = \file_get_contents(\getenv("FILES_FOR_UPLOAD") . $filename);

$this->setTheLdapAttributeOfTheEntryTo(
$attribute, $entry, $value
);
Expand Down Expand Up @@ -306,12 +309,12 @@ public function createLDAPUsers($amount, $prefix, $ou) {
$ldap->add($ouDN, $entry);
$this->featureContext->setToDeleteDNs($ouDN);
}

$lenOfSuffix = \strlen((string)$amount);
for ($i = 0; $i < $amount; $i++) {
$uid = $prefix . \str_pad($i, $lenOfSuffix, '0', STR_PAD_LEFT);
$newDN = 'uid=' . $uid . ',ou=' . $ou . ',' . $this->featureContext->getLdapBaseDN();

$entry = [];
$entry['cn'] = $uid;
$entry['sn'] = $i;
Expand All @@ -322,7 +325,7 @@ public function createLDAPUsers($amount, $prefix, $ou) {
$entry['displayName'] = $uid;
$entry['gidNumber'] = 5000;
$entry['uidNumber'] = $maxUidNumber + $i + 1;

$ldap->add($newDN, $entry);
$this->featureContext->addUserToCreatedUsersList(
$uid, $uid, $uid, null, false
Expand Down

0 comments on commit 45468de

Please sign in to comment.