* adjust for test task.
This commit is contained in:
@@ -1315,85 +1315,6 @@ class testcaseModel extends model
|
||||
return $cases;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get report data of testcase per run result.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getDataOfTestCasePerRunResult()
|
||||
{
|
||||
$datas = $this->dao->select('lastRunResult AS name, COUNT(*) AS value')->from(TABLE_CASE)->where($this->reportCondition())->groupBy('name')->orderBy('value DESC')->fetchAll('name');
|
||||
if(!$datas) return array();
|
||||
foreach($datas as $result => $data) if(isset($this->lang->testcase->resultList[$result])) $data->name = $this->lang->testcase->resultList[$result];
|
||||
return $datas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get report data of testcase per status.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getDataOfTestCasePerStatus()
|
||||
{
|
||||
$datas = $this->dao->select('status AS name, COUNT(*) AS value')->from(TABLE_CASE)->where($this->reportCondition())->groupBy('name')->orderBy('value DESC')->fetchAll('name');
|
||||
if(!$datas) return array();
|
||||
foreach($datas as $result => $data) if(isset($this->lang->testcase->statusList[$result])) $data->name = $this->lang->testcase->statusList[$result];
|
||||
return $datas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get report data of testcase per Type.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getDataOfTestCasePerType()
|
||||
{
|
||||
$datas = $this->dao->select('type AS name, COUNT(*) AS value')->from(TABLE_CASE)->where($this->reportCondition())->groupBy('name')->orderBy('value DESC')->fetchAll('name');
|
||||
if(!$datas) return array();
|
||||
foreach($datas as $result => $data) if(isset($this->lang->testcase->typeList[$result])) $data->name = $this->lang->testcase->typeList[$result];
|
||||
return $datas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get report condition from session.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function reportCondition()
|
||||
{
|
||||
if(isset($_SESSION['testcaseQueryCondition']))
|
||||
{
|
||||
if(!$this->session->testcaseOnlyCondition) return 'id in (' . preg_replace('/SELECT .* FROM/', 'SELECT t1.id FROM', $this->session->testcaseQueryCondition) . ')';
|
||||
return $this->session->testcaseQueryCondition;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge the default chart settings and the settings of current chart.
|
||||
*
|
||||
* @param string $chartType
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function mergeChartOption($chartType)
|
||||
{
|
||||
$chartOption = $this->lang->testcase->report->$chartType;
|
||||
$commonOption = $this->lang->testcase->report->options;
|
||||
|
||||
$chartOption->graph->caption = $this->lang->testcase->report->charts[$chartType];
|
||||
if(!isset($chartOption->type)) $chartOption->type = $commonOption->type;
|
||||
if(!isset($chartOption->width)) $chartOption->width = $commonOption->width;
|
||||
if(!isset($chartOption->height)) $chartOption->height = $commonOption->height;
|
||||
|
||||
/* 合并配置。*/
|
||||
foreach($commonOption->graph as $key => $value) if(!isset($chartOption->graph->$key)) $chartOption->graph->$key = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether force review
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user