* adjust testcass for batchCaseTypeChange.

This commit is contained in:
pengjiangxiu
2017-03-22 14:11:33 +08:00
parent cec824e540
commit 7ad0ecc388
4 changed files with 81 additions and 10 deletions
+27
View File
@@ -798,9 +798,36 @@ class testcaseModel extends model
$this->dao->update(TABLE_CASE)->data($case)->autoCheck()->where('id')->eq((int)$caseID)->exec();
if(!dao::isError()) $allChanges[$caseID] = common::createChanges($oldCase, $case);
}
return $allChanges;
}
/**
* Batch case type change.
*
* @param array $caseIDList
* @param string $result
* @access public
* @return array
*/
public function batchCaseTypeChange($caseIdList, $result)
{
$now = helper::now();
$actions = array();
$this->loadModel('action');
foreach($caseIdList as $caseID)
{
$case = new stdClass();
$case->lastEditedBy = $this->app->user->account;
$case->lastEditedDate = $now;
$case->type = $result;
$this->dao->update(TABLE_CASE)->data($case)->autoCheck()->where('id')->eq($caseID)->exec();
$this->action->create('case', $caseID, 'Edited', '', ucfirst($result));
}
}
/**
* Join steps to a string, thus can diff them.
*