mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-19 00:28:47 +02:00
Merge remote-tracking branch 'origin/support/2.7' into support/3.0
# Conflicts: # test/core/DBObjectTest.php
This commit is contained in:
@@ -28,6 +28,7 @@ namespace Combodo\iTop\Test\UnitTest\Core;
|
||||
|
||||
use Combodo\iTop\Test\UnitTest\ItopDataTestCase;
|
||||
use DBObject;
|
||||
use MetaModel;
|
||||
|
||||
|
||||
/**
|
||||
@@ -94,6 +95,39 @@ class DBObjectTest extends ItopDataTestCase
|
||||
static::assertNull($oObject->GetOriginal('sla_tto_passed'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function testListPreviousValuesForUpdatedAttributes()
|
||||
{
|
||||
$oOrg = $this->CreateOrganization('testListPreviousValuesForUpdatedAttributes');
|
||||
|
||||
$this->assertCount(0, $oOrg->ListChanges());
|
||||
$oOrg->Set('code', strtoupper('testListPreviousValuesForUpdatedAttributes'));
|
||||
$this->assertCount(1, $oOrg->ListChanges());
|
||||
$oOrg->DBUpdate();
|
||||
$this->assertCount(0, $oOrg->ListChanges());
|
||||
$this->assertCount(1, $oOrg->ListPreviousValuesForUpdatedAttributes());
|
||||
|
||||
$oOrg->DBUpdate();
|
||||
|
||||
$this->assertCount(0, $oOrg->ListChanges());
|
||||
$this->assertCount(1, $oOrg->ListPreviousValuesForUpdatedAttributes());
|
||||
|
||||
$oOrg->DBDelete();
|
||||
|
||||
$oOrg = MetaModel::NewObject('Organization');
|
||||
$oOrg->Set('name', 'testListPreviousValuesForUpdatedAttributes');
|
||||
$oOrg->DBInsert();
|
||||
$oOrg->Set('code', strtoupper('testListPreviousValuesForUpdatedAttributes'));
|
||||
$oOrg->DBUpdate();
|
||||
$oOrg->DBUpdate();
|
||||
$this->markTestIncomplete('This test has not been implemented yet. wait for N°4967 fix');
|
||||
$this->debug("ERROR: N°4967 - 'Previous Values For Updated Attributes' not updated if DBUpdate is called without modifying the object");
|
||||
//$this->assertCount(0, $oOrg->ListPreviousValuesForUpdatedAttributes());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers DBObject::NewObject
|
||||
* @covers DBObject::Get
|
||||
|
||||
Reference in New Issue
Block a user