mirror of
https://github.com/Karaka-Management/oms-Admin.git
synced 2026-01-30 21:38:40 +00:00
cleanup tests and use @covers more
This commit is contained in:
parent
79c9ceef0f
commit
ae02a0e4b3
|
|
@ -66,7 +66,9 @@ class Installer extends InstallerAbstract
|
|||
$query = new Builder($con);
|
||||
$query->insert('country_name', 'country_native', 'country_code2', 'country_code3', 'country_codenum')->into('country');
|
||||
|
||||
$countries = $query->select('*')->from('country')->execute();
|
||||
$querySqlite = new Builder($sqlite);
|
||||
$countries = $querySqlite->select('*')->from('country')->execute();
|
||||
|
||||
foreach ($countries as $country) {
|
||||
$query->values(
|
||||
$country['country_name'],
|
||||
|
|
@ -97,7 +99,9 @@ class Installer extends InstallerAbstract
|
|||
$query = new Builder($con);
|
||||
$query->insert('language_name', 'language_native', 'language_639_2T', 'language_639_2B', 'language_639_3')->into('language');
|
||||
|
||||
$languages = $query->select('*')->from('language')->execute();
|
||||
$querySqlite = new Builder($sqlite);
|
||||
$languages = $querySqlite->select('*')->from('language')->execute();
|
||||
|
||||
foreach ($languages as $language) {
|
||||
$query->values(
|
||||
$language['language_name'],
|
||||
|
|
|
|||
|
|
@ -430,21 +430,23 @@ final class ApiController extends Controller
|
|||
*/
|
||||
private function createProfileForAccount(Account $account, RequestAbstract $request) : void
|
||||
{
|
||||
if (((string) ($request->getData('password') ?? '')) !== ''
|
||||
&& ((string) ($request->getData('login') ?? '')) !== ''
|
||||
if (((string) ($request->getData('password') ?? '')) === ''
|
||||
|| ((string) ($request->getData('login') ?? '')) === ''
|
||||
) {
|
||||
$old = clone $account;
|
||||
|
||||
$this->app->moduleManager->get('Profile')->apiProfileCreateDbEntry(
|
||||
new \Modules\Profile\Models\Profile($account),
|
||||
$request
|
||||
);
|
||||
|
||||
$this->updateModel($request, $old, $account, function() use($account) : void {
|
||||
$account->setLoginTries((int) $this->app->appSettings->get(Settings::LOGIN_TRIES));
|
||||
AccountMapper::update($account);
|
||||
}, 'account');
|
||||
return;
|
||||
}
|
||||
|
||||
$old = clone $account;
|
||||
|
||||
$this->app->moduleManager->get('Profile')->apiProfileCreateDbEntry(
|
||||
new \Modules\Profile\Models\Profile($account),
|
||||
$request
|
||||
);
|
||||
|
||||
$this->updateModel($request, $old, $account, function() use($account) : void {
|
||||
$account->setLoginTries((int) $this->app->appSettings->get(Settings::LOGIN_TRIES));
|
||||
AccountMapper::update($account);
|
||||
}, 'account');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user