mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-20 00:58:48 +02:00
N°7636 - Too many OQL requests executed in order to display a lnk (#661)
This commit is contained in:
@@ -21,6 +21,8 @@ namespace Combodo\iTop\Test\UnitTest\Core;
|
||||
|
||||
use Attachment;
|
||||
use AttributeDateTime;
|
||||
use Combodo\iTop\Application\WebPage\iTopWebPage;
|
||||
use Combodo\iTop\Application\WebPage\WebPage;
|
||||
use Combodo\iTop\Service\Events\EventData;
|
||||
use Combodo\iTop\Test\UnitTest\ItopDataTestCase;
|
||||
use CoreException;
|
||||
@@ -1415,4 +1417,28 @@ class DBObjectTest extends ItopDataTestCase
|
||||
$this->assertEquals("2024-01-15 09:45:00", $oObject->Get('end_date'), 'SetComputedDate +2 weeks on a WorkOrder DateTimeAttribute');
|
||||
|
||||
}
|
||||
/**
|
||||
* @covers DBObject::Get
|
||||
*/
|
||||
public function testGetLinkSet()
|
||||
{
|
||||
$iServer = $this->GivenObjectInDB('Server', [
|
||||
'name' => 'The Boss',
|
||||
]);
|
||||
|
||||
$iUserRequest = $this->GivenObjectInDB('UserRequest', [
|
||||
'ref' => 'UR1', 'title' => 'UR1', 'description' => 'UR1', 'caller_id' => 3, 'org_id' => 3, 'service_id' => 1,
|
||||
'functionalcis_list' => [
|
||||
"functionalci_id:$iServer"
|
||||
],
|
||||
]);
|
||||
$oUserRequest = MetaModel::GetObject('UserRequest', $iUserRequest);
|
||||
|
||||
$this->assertDBQueryCount(2, function () use (&$oUserRequest) {
|
||||
$oUserRequest->Get('functionalcis_list');
|
||||
});
|
||||
$this->assertDBQueryCount(0, function () use (&$oUserRequest) {
|
||||
$oUserRequest->Get('functionalcis_list');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user