Compare commits

...

1 Commits

Author SHA1 Message Date
odain
eb40968e34 ci: add CreateContactlessUser method in test framework 2022-10-25 09:26:57 +02:00

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',