mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
N°6299 - DBUpdate regression in 3.1 when setting a field with same value in the concerned object
This commit is contained in:
@@ -118,6 +118,12 @@ class DBObjectTest extends ItopDataTestCase
|
||||
$this->assertCount(0, $oOrg->ListChanges());
|
||||
$this->assertCount(0, $oOrg->ListPreviousValuesForUpdatedAttributes());
|
||||
|
||||
$oOrg->Set('name', $oOrg->Get('name'));
|
||||
$this->assertCount(0, $oOrg->ListChanges());
|
||||
$oOrg->DBUpdate();
|
||||
$this->assertCount(0, $oOrg->ListChanges());
|
||||
$this->assertCount(0, $oOrg->ListPreviousValuesForUpdatedAttributes());
|
||||
|
||||
$oOrg->DBDelete();
|
||||
|
||||
$oOrg = MetaModel::NewObject('Organization');
|
||||
@@ -236,11 +242,15 @@ class DBObjectTest extends ItopDataTestCase
|
||||
});
|
||||
|
||||
$this->assertDBQueryCount(0, function() use (&$oBordeaux, &$oObject){
|
||||
/** @var DBObject $oObject */
|
||||
$oObject->Set('location_id', $oBordeaux);
|
||||
static::assertEquals('IT Department', $oObject->Get('org_id_friendlyname'));
|
||||
static::assertEquals('IT Department', $oObject->Get('org_name'));
|
||||
static::assertEquals('Bordeaux', $oObject->Get('location_id_friendlyname'));
|
||||
});
|
||||
|
||||
static::assertEquals('Bordeaux', $oObject->Get('location_id_friendlyname'));
|
||||
// static::assertEquals('toto', $oObject->EvaluateExpression(\Expression::FromOQL("CONCAT(org_name, '-', location_id_friendlyname)")));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -365,11 +365,11 @@ class UserLocalTest extends ItopDataTestCase
|
||||
'oExpectedBefore' => null,
|
||||
'bRenewedDateTouched' => true,
|
||||
),
|
||||
/*'EXPIRE_NEVER (default mode): nothing changed on UserLocal' => array(
|
||||
'EXPIRE_NEVER (default mode): nothing changed on UserLocal' => array(
|
||||
'sExpirationMode' => 'never_expire',
|
||||
'oExpectedBefore' => null,
|
||||
'bRenewedDateTouched' => false,
|
||||
),*/
|
||||
),
|
||||
'EXPIRE_FORCE: nominal case' => array(
|
||||
'sExpirationMode' => 'force_expire',
|
||||
'oExpectedBefore' => null,
|
||||
|
||||
Reference in New Issue
Block a user