enhance ItopDataTestCase->CreateUser to avoid be able to avoid hardcoded contact_id

This commit is contained in:
odain
2022-02-11 14:10:02 +01:00
parent 9ad341f73a
commit df1e19dc43

View File

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