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

[Tests-Only] Removed unused variable from exception message #559

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
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
13 changes: 7 additions & 6 deletions tests/acceptance/features/bootstrap/UserLdapGeneralContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ 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 +149,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 +210,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 +307,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 +323,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