Move TrimValue() base definition to AttributeDefinition class, assign DBObject::SetTrim old behavior to it

This commit is contained in:
Stephen Abello
2026-07-13 15:34:09 +02:00
parent e08897a7ca
commit 39cadd64b6
2 changed files with 31 additions and 0 deletions

View File

@@ -1387,6 +1387,17 @@ class DBObjectTest extends ItopDataTestCase
$this->assertEquals($sResult, $oOrganisation->Get('name'), 'SetTrim must limit string to 255 characters');
}
/**
* @covers DBObject::SetTrim
*/
public function testSetTrimOnNonStringAttributeDoesNotTrim()
{
$oTicket = MetaModel::NewObject(UserRequest::class);
$oTicket->SetTrim('caller_id', '15');
$this->assertEquals(15, $oTicket->Get('caller_id'), 'SetTrim should keep non-string attributes untouched before regular Set conversion');
}
/**
* @covers DBObject::SetComputedDate
* @return void