mirror of
https://github.com/Combodo/iTop.git
synced 2026-03-04 00:24:14 +01:00
ci: fix by create 10 URs in CI env
This commit is contained in:
@@ -4,12 +4,28 @@ use Combodo\iTop\Test\UnitTest\ItopDataTestCase;
|
||||
|
||||
class DBObjectSetTest extends ItopDataTestCase
|
||||
{
|
||||
public const USE_TRANSACTION = true;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp(); // TODO: Change the autogenerated stub
|
||||
$this->CreateURs();
|
||||
}
|
||||
|
||||
protected function tearDown(): void
|
||||
{
|
||||
CMDBSource::TriggerExceptionWhenSqlQuery(null);
|
||||
parent::tearDown(); // TODO: Change the autogenerated stub
|
||||
}
|
||||
|
||||
private function CreateURs()
|
||||
{
|
||||
$this->CreateTestOrganization();
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
$this->CreateTicket($i);
|
||||
}
|
||||
}
|
||||
|
||||
public function testCount()
|
||||
{
|
||||
$oSearch = DBObjectSearch::FromOQL_AllData("SELECT UserRequest");
|
||||
@@ -20,7 +36,7 @@ class DBObjectSetTest extends ItopDataTestCase
|
||||
$this->assertEquals($iCount, $oSet->Count());
|
||||
$this->assertEquals($iCount, $oSet->CountWithLimit(0));
|
||||
$this->assertTrue($oSet->CountExceeds(0));
|
||||
|
||||
|
||||
//no DB SQL query: exception will be raised after here
|
||||
CMDBSource::TriggerExceptionWhenSqlQuery(__METHOD__.' :'.__LINE__);
|
||||
$this->assertEquals($iCount, $oSet->Count(), 'should use cache and not call DB again');
|
||||
|
||||
Reference in New Issue
Block a user