Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Commit

Permalink
Merge branch 'pu/pm/testsUnrollCreatedAccounts' into '2022.11'
Browse files Browse the repository at this point in the history
tests(TB accounts) added unittest plugin to unroll accounts -> emailUsers

See merge request tine20/tine20!3697
  • Loading branch information
paulmhh committed Apr 12, 2023
2 parents 1dc3847 + faab73c commit 1d822a0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/tine20/Felamimail/Controller/AccountMock.php
Expand Up @@ -53,7 +53,7 @@ protected function _inspectAfterCreate($_createdRecord, Tinebase_Record_Interfac
Tinebase_TransactionManager::getInstance()->unitTestRemoveTransactionable($smtpDb);
} catch (PDOException $e) {}
}
$this->createdAccounts[] = $_createdRecord;
$this->createdAccounts[] = Tinebase_User::getInstance()->getFullUserById($_createdRecord->user_id);
}
}

Expand All @@ -63,9 +63,12 @@ public function cleanUp()
return;
}

/** @var Felamimail_Model_Account $account */
/** @var Tinebase_Model_FullUser $account */
foreach ($this->createdAccounts as $account) {
Tinebase_EmailUser_XpropsFacade::deleteEmailUsers($account);
$account->setId($account->xprops()['emailUserIdImap']);
Tinebase_EmailUser::getInstance()->inspectDeleteUser($account);
$account->setId($account->xprops()['emailUserIdSmtp']);
Tinebase_EmailUser::getInstance(Tinebase_Config::SMTP)->inspectDeleteUser($account);
}
$this->createdAccounts = [];
}
Expand Down

0 comments on commit 1d822a0

Please sign in to comment.