mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
N°8259 - Problem with GetMaxSize on AttributeText
This commit is contained in:
@@ -22,6 +22,7 @@ namespace Combodo\iTop\Test\UnitTest\Core;
|
||||
use Attachment;
|
||||
use AttributeDateTime;
|
||||
use Combodo\iTop\Service\Events\EventData;
|
||||
use EventRestService;
|
||||
use Combodo\iTop\Test\UnitTest\ItopDataTestCase;
|
||||
use CoreException;
|
||||
use DateTime;
|
||||
@@ -1415,4 +1416,22 @@ class DBObjectTest extends ItopDataTestCase
|
||||
$this->assertEquals("2024-01-15 09:45:00", $oObject->Get('end_date'), 'SetComputedDate +2 weeks on a WorkOrder DateTimeAttribute');
|
||||
|
||||
}
|
||||
|
||||
public function testStringFitsInField()
|
||||
{
|
||||
//🎁 character is 4 bytes long
|
||||
$sTooLongText = str_repeat('🎁', 17000);
|
||||
$oLog = new EventRestService();
|
||||
$this->assertFalse($oLog->StringFitsInField('json_output', $sTooLongText));
|
||||
|
||||
$sCorrectLengthText = str_repeat('🎁', 16383);
|
||||
$this->assertTrue($oLog->StringFitsInField('json_output', $sCorrectLengthText));
|
||||
|
||||
|
||||
$sCorrectLengthString = str_repeat('🎁', 255);
|
||||
$this->assertTrue($oLog->StringFitsInField('operation', $sCorrectLengthString));
|
||||
|
||||
$sTooLongString = str_repeat('🎁', 256);
|
||||
$this->assertFalse($oLog->StringFitsInField('operation', $sTooLongString));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user