mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-12 23:14:18 +01:00
N°4720 - fix Deprecation warnings with ormLinkSet->UpdateFromCompleteList API
This commit is contained in:
@@ -616,10 +616,9 @@ abstract class ItopDataTestCase extends ItopTestCase
|
||||
$sPassword = $sLogin;
|
||||
}
|
||||
|
||||
$oUserProfile = new URP_UserProfile();
|
||||
$oUserProfile->Set('profileid', $iProfileId);
|
||||
$oUserProfile->Set('reason', 'UNIT Tests');
|
||||
$oSet = DBObjectSet::FromObject($oUserProfile);
|
||||
$oSet = new \ormLinkSet(\UserLocal::class, 'profile_list', \DBObjectSet::FromScratch(\URP_UserProfile::class));
|
||||
$oSet->AddItem(MetaModel::NewObject('URP_UserProfile', ['profileid' => $iProfileId, 'reason' => 'UNIT Tests']));
|
||||
|
||||
/** @var \UserLocal $oUser */
|
||||
$oUser = $this->createObject('UserLocal', array(
|
||||
'login' => $sLogin,
|
||||
|
||||
@@ -33,7 +33,7 @@ use DBObject;
|
||||
use DBObjectSearch;
|
||||
use DBObjectSet;
|
||||
use DeleteException;
|
||||
use URP_UserProfile;
|
||||
use MetaModel;
|
||||
use UserRights;
|
||||
use utils;
|
||||
|
||||
@@ -421,10 +421,8 @@ class UserRightsTest extends ItopDataTestCase
|
||||
$this->AddProfileToUser($oUser, 3);
|
||||
|
||||
// Keep only the profile 3 (remove profile 1)
|
||||
$oUserProfile = new URP_UserProfile();
|
||||
$oUserProfile->Set('profileid', 3);
|
||||
$oUserProfile->Set('reason', 'UNIT Tests');
|
||||
$oSet = DBObjectSet::FromObject($oUserProfile);
|
||||
$oSet = new \ormLinkSet(\UserLocal::class, 'profile_list', \DBObjectSet::FromScratch(\URP_UserProfile::class));
|
||||
$oSet->AddItem(MetaModel::NewObject('URP_UserProfile', ['profileid' => 3, 'reason' => 'UNIT Tests']));
|
||||
$oUser->Set('profile_list', $oSet);
|
||||
|
||||
try {
|
||||
|
||||
@@ -69,10 +69,8 @@ class BulkChangeExtKeyTest extends ItopDataTestCase {
|
||||
|
||||
$sUid = $this->GetUid();
|
||||
|
||||
$oUserProfile = new \URP_UserProfile();
|
||||
$oUserProfile->Set('profileid', $oProfile->GetKey());
|
||||
$oUserProfile->Set('reason', 'UNIT Tests');
|
||||
$oSet = \DBObjectSet::FromObject($oUserProfile);
|
||||
$oSet = new \ormLinkSet(\UserLocal::class, 'profile_list', \DBObjectSet::FromScratch(\URP_UserProfile::class));
|
||||
$oSet->AddItem(MetaModel::NewObject('URP_UserProfile', ['profileid' => $oProfile->GetKey(), 'reason' => 'UNIT Tests']));
|
||||
|
||||
$oPerson = $this->CreatePerson('666', $oOrg2->GetKey());
|
||||
$oUser = $this->createObject('UserLocal', array(
|
||||
|
||||
Reference in New Issue
Block a user