adapt tests for saas targets

This commit is contained in:
odain
2023-11-29 16:09:36 +01:00
parent fc2ba866f2
commit c61565101e
2 changed files with 14 additions and 14 deletions

View File

@@ -40,7 +40,6 @@ use utils;
/**
* @group itopRequestMgmt
* @group userRights
* @group defaultProfiles
*/
class UserRightsTest extends ItopDataTestCase
{
@@ -50,7 +49,7 @@ class UserRightsTest extends ItopDataTestCase
try {
utils::GetConfig()->SetModuleSetting('authent-local', 'password_validation.pattern', '');
self::CreateUser('admin', 1);
self::CreateContactlessUser('admin', 1);
}
catch (CoreCannotSaveObjectException $e) {
}
@@ -78,7 +77,7 @@ class UserRightsTest extends ItopDataTestCase
$sLogin = $sLoginPrefix.$iCount;
$iCount++;
$oUser = self::CreateUser($sLogin, $iProfileId);
$oUser = self::CreateContactlessUser($sLogin, $iProfileId);
$_SESSION = array();
UserRights::Login($sLogin);
return $oUser;
@@ -494,7 +493,7 @@ class UserRightsTest extends ItopDataTestCase
{
utils::GetConfig()->Set('security.hide_administrators', $bHideAdministrators);
$oUserAdmin = $this->CreateUser('admin1', 1);
$oUserAdmin = $this->CreateContactlessUser('admin1', 1);
$this->CreateUniqueUserAndLogin('test1', 2); // portal user
$oSearch = new DBObjectSearch('URP_UserProfile');

View File

@@ -30,7 +30,6 @@ use utils;
*
* @package Combodo\iTop\Test\UnitTest\Synchro
* @group dataSynchro
* @group defaultProfiles
*/
class DataSynchroTest extends ItopDataTestCase
{
@@ -138,17 +137,19 @@ class DataSynchroTest extends ItopDataTestCase
// Create the data source
//
$oDataSource = new SynchroDataSource();
$oDataSource->Set('name', 'Test data sync '.time());
$oDataSource->Set('description', 'unit test - created automatically');
$oDataSource->Set('status', 'production');
$oDataSource->Set('user_id', 0);
$oDataSource->Set('scope_class', $sClass);
$aDsParams = [
'name' => 'Test data sync '.time(),
'description' => 'unit test - created automatically',
'status' => 'production',
'user_id' => 0,
'scope_class' => $sClass
];
foreach ($aSourceProperties as $sProperty => $value)
{
$oDataSource->Set($sProperty, $value);
$aDsParams[$sProperty] = $value;
}
$iDataSourceId = $oDataSource->DBInsert();
$oDataSource = $this->createObject('SynchroDataSource', $aDsParams);
$iDataSourceId = $oDataSource->GetKey();
$oAttributeSet = $oDataSource->Get('attribute_list');
while ($oAttribute = $oAttributeSet->Fetch())
@@ -382,7 +383,7 @@ class DataSynchroTest extends ItopDataTestCase
'source_data' => array(
array('primary_key', 'login', 'password', 'profile_list'),
array(
array('user_A', 'login_A', 'password_A', 'profileid:10;reason:he/she is managing services'),
array('user_A', 'login_A', 'password_A', 'profileid:3;reason:he/she is managing services'),
),
),
'target_data' => array(