mirror of
https://github.com/Combodo/iTop.git
synced 2026-03-11 12:04:12 +01:00
N°7803 ✅ Test iTop Hub move to production (compilation phase)
This commit is contained in:
@@ -1368,4 +1368,28 @@ abstract class ItopDataTestCase extends ItopTestCase
|
||||
]);
|
||||
return $sLogin;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sPassword
|
||||
* @param array $aProfiles Profile names Example: ['Administrator']
|
||||
*
|
||||
* @return string The unique login
|
||||
* @throws \Exception
|
||||
*/
|
||||
protected function GivenUserInDB(string $sPassword, array $aProfiles): string
|
||||
{
|
||||
$sLogin = 'demo_test_'.uniqid(__CLASS__, true);
|
||||
|
||||
$aProfileList = array_map(function($sProfileId) {
|
||||
return 'profileid:'.self::$aURP_Profiles[$sProfileId];
|
||||
}, $aProfiles);
|
||||
|
||||
$iUser = $this->GivenObjectInDB('UserLocal', [
|
||||
'login' => $sLogin,
|
||||
'password' => $sPassword,
|
||||
'language' => 'EN US',
|
||||
'profile_list' => $aProfileList,
|
||||
]);
|
||||
return $sLogin;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user