ci: add CreateContactlessUser method in test framework

This commit is contained in:
odain
2022-10-25 09:26:57 +02:00
parent 766c9f0e7e
commit 8fba396f1c

View File

@@ -414,6 +414,20 @@ class ItopDataTestCase extends ItopTestCase
* @throws Exception
*/
protected function CreateUser($sLogin, $iProfileId, $sPassword=null, $iContactid=2)
{
$oUser = $this->CreateContactlessUser($sLogin, $iProfileId, $sPassword);
$oUser->Set('contactid', $iContactid);
return $oUser;
}
/**
* @param string $sLogin
* @param int $iProfileId
*
* @return \DBObject
* @throws Exception
*/
protected function CreateContactlessUser($sLogin, $iProfileId, $sPassword=null)
{
if (empty($sPassword)){
$sPassword = $sLogin;
@@ -424,7 +438,6 @@ class ItopDataTestCase extends ItopTestCase
$oUserProfile->Set('reason', 'UNIT Tests');
$oSet = DBObjectSet::FromObject($oUserProfile);
$oUser = $this->createObject('UserLocal', array(
'contactid' => $iContactid,
'login' => $sLogin,
'password' => $sPassword,
'language' => 'EN US',