mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
✅ ItopDataTestCase : extract UR params to a method to allow overrides
This commit is contained in:
@@ -286,18 +286,26 @@ class ItopDataTestCase extends ItopTestCase
|
||||
{
|
||||
$oFilter = DBSearch::FromOQL($sOQL);
|
||||
$aRes = $oFilter->ToDataArray(array('id'));
|
||||
foreach ($aRes as $aRow)
|
||||
{
|
||||
foreach ($aRes as $aRow) {
|
||||
$this->debug($aRow);
|
||||
$iKey = $aRow['id'];
|
||||
if (!empty($iKey))
|
||||
{
|
||||
if (!empty($iKey)) {
|
||||
$oObject = MetaModel::GetObject($sClass, $iKey);
|
||||
$oObject->DBDelete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function GetUserRequestParams($iNum) {
|
||||
return [
|
||||
'ref' => 'Ticket_'.$iNum,
|
||||
'title' => 'BUG 1161_'.$iNum,
|
||||
//'request_type' => 'incident',
|
||||
'description' => 'Add aggregate functions',
|
||||
'org_id' => $this->getTestOrgId(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a UserRequest in database
|
||||
*
|
||||
@@ -315,13 +323,7 @@ class ItopDataTestCase extends ItopTestCase
|
||||
* @uses createObject
|
||||
*/
|
||||
protected function CreateUserRequest($iNum, $aUserRequestCustomParams = []) {
|
||||
$aUserRequestDefaultParams = [
|
||||
'ref' => 'Ticket_'.$iNum,
|
||||
'title' => 'BUG 1161_'.$iNum,
|
||||
//'request_type' => 'incident',
|
||||
'description' => 'Add aggregate functions',
|
||||
'org_id' => $this->getTestOrgId(),
|
||||
];
|
||||
$aUserRequestDefaultParams = $this->GetUserRequestParams($iNum);
|
||||
|
||||
$aUserRequestParams = array_merge($aUserRequestDefaultParams, $aUserRequestCustomParams);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user