mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-30 05:58:46 +02:00
Merge remote-tracking branch 'origin/support/3.2' into develop
This commit is contained in:
@@ -5,6 +5,7 @@ namespace Combodo\iTop\Test\UnitTest\Core;
|
||||
|
||||
use Combodo\iTop\Test\UnitTest\ItopDataTestCase;
|
||||
use CoreException;
|
||||
use DBObjectSearch;
|
||||
use MetaModel;
|
||||
|
||||
/**
|
||||
@@ -456,6 +457,31 @@ class MetaModelTest extends ItopDataTestCase
|
||||
'Non existing person' => [10, false],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @throws CoreException
|
||||
* @throws \OQLException
|
||||
*/
|
||||
public function testPurgeData(){
|
||||
// Set max_chunk_size to 2 (default 1000) to test chunk deletion with only 10 items
|
||||
$oConfig = MetaModel::GetConfig();
|
||||
$oConfig->Set('purge_data.max_chunk_size', 2);
|
||||
MetaModel::SetConfig($oConfig);
|
||||
|
||||
$aPkPerson = [];
|
||||
for ($i=0; $i < 10; $i++) {
|
||||
$oPerson = $this->CreatePerson($i, 1);
|
||||
$sClass = get_class($oPerson);
|
||||
$aPkPerson[] = $oPerson->GetKey();
|
||||
}
|
||||
|
||||
$sDeleteOQL = 'SELECT '.$sClass.' WHERE id IN ('.implode(',', $aPkPerson).')';
|
||||
$oFilter = DBObjectSearch::FromOQL($sDeleteOQL);
|
||||
|
||||
$iNbDelete = MetaModel::PurgeData($oFilter);
|
||||
$this->assertEquals($iNbDelete, 10, 'MetaModel::PurgeData must delete 10 objects per batch of 2 items');
|
||||
}
|
||||
}
|
||||
|
||||
abstract class Wizzard
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.2">
|
||||
</itop_design>
|
||||
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.1">
|
||||
</itop_design>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.1">
|
||||
<branding/>
|
||||
</itop_design>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.2">
|
||||
<branding>
|
||||
<main_favicon _delta="define">
|
||||
<fileref ref="logo_rvb"/>
|
||||
</main_favicon>
|
||||
<login_favicon _delta="define">
|
||||
<fileref ref="logo_log"/>
|
||||
</login_favicon>
|
||||
<portal_favicon _delta="define">
|
||||
<fileref ref="logo_log"/>
|
||||
</portal_favicon>
|
||||
</branding>
|
||||
</itop_design>
|
||||
@@ -143,6 +143,8 @@ class iTopDesignFormatTest extends ItopTestCase
|
||||
'3.0 to 1.7' => ['sXmlFileName' => '3.0_to_1.7'],
|
||||
'3.0 to 3.1' => ['sXmlFileName' => '3.0_to_3.1'],
|
||||
'3.1 to 3.0' => ['sXmlFileName' => '3.1_to_3.0'],
|
||||
'3.1 to 3.2' => ['sXmlFileName' => '3.1_to_3.2'],
|
||||
'3.2 to 3.1' => ['sXmlFileName' => '3.2_to_3.1'],
|
||||
'Bug_4569' => ['sXmlFileName' => 'Bug_4569'],
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user