mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
adapt tests for saas targets
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user