Skip to content

Commit

Permalink
[Tests-Only] edit users only when running with oc10 backend
Browse files Browse the repository at this point in the history
  • Loading branch information
dpakach committed Nov 24, 2020
1 parent ccf14a2 commit 7ad53ab
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/acceptance/features/bootstrap/Provisioning.php
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,7 @@ public function usersHaveBeenCreated(
} else {
$attributesToCreateUser['userid'] = $userAttributes['userid'];
$attributesToCreateUser['password'] = $userAttributes['password'];
$attributesToCreateUser['displayname'] = $userAttributes['displayName'];
if (OcisHelper::isTestingOnOcisOrReva()) {
$attributesToCreateUser['username'] = $userAttributes['userid'];
if ($userAttributes['email'] === null) {
Expand Down Expand Up @@ -972,15 +973,19 @@ public function usersHaveBeenCreated(
$users = [];
$editData = [];
foreach ($usersAttributes as $userAttributes) {
\array_push($users, $userAttributes['userid']);
$this->addUserToCreatedUsersList($userAttributes['userid'], $userAttributes['password'], $userAttributes['displayName'], $userAttributes['email']);

if (OcisHelper::isTestingOnOcisOrReva()) {
OcisHelper::createEOSStorageHome(
$this->getBaseUrl(),
$userAttributes['userid'],
$userAttributes['password']
);
// We don't need to set displayName and email while running in oCIS
// As they are set when creating the user
continue;
}
\array_push($users, $userAttributes['userid']);
$this->addUserToCreatedUsersList($userAttributes['userid'], $userAttributes['password'], $userAttributes['displayName'], $userAttributes['email']);
if (isset($userAttributes['displayName'])) {
\array_push($editData, ['user' => $userAttributes['userid'], 'key' => 'displayname', 'value' => $userAttributes['displayName']]);
}
Expand All @@ -989,7 +994,7 @@ public function usersHaveBeenCreated(
}
}
// Edit the users in parallel to make the process faster.
if (!$useLdap && \count($editData) > 0) {
if (!OcisHelper::isTestingOnOcisOrReva() && !$useLdap && \count($editData) > 0) {
UserHelper::editUserBatch(
$this->getBaseUrl(),
$editData,
Expand Down

0 comments on commit 7ad53ab

Please sign in to comment.