mirror of
https://github.com/Combodo/iTop.git
synced 2026-08-05 21:38:24 +02:00
Move TrimValue() base definition to AttributeDefinition class, assign DBObject::SetTrim old behavior to it
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user