* [unittest] fix unittest.

This commit is contained in:
qixinzhi
2025-07-08 02:23:52 +00:00
parent 7b38e961a5
commit 9d8cf9728d
6 changed files with 8 additions and 9 deletions
+1 -1
View File
@@ -3406,7 +3406,7 @@ class baseRouter
foreach(dbh::$queries as $key => $query)
{
fwrite($fh, " $query\n");
fwrite($fh, ' └' . dbh::$traces[$key] . "\n");
if(!empty(dbh::$traces)) fwrite($fh, ' └' . (dbh::$traces[$key] ?? '') . "\n");
}
fwrite($fh, "\n");
fclose($fh);
@@ -58,6 +58,7 @@ class chartTest
public function isClickableTest(int $chartID, string $action): string
{
$chart = $this->objectModel->getByID($chartID);
if(!$chart) return 'false';
return $this->objectModel->isClickable($chart, $action) ? 'true' : 'false';
}
}
+2 -2
View File
@@ -2216,7 +2216,7 @@ class screenModel extends model
$sourceData = array();
$sql = $this->setFilterSQL($chart);
$results = $this->bi->queryWithDriver($driver, $sql);
$results = $this->bi->queryWithDriver($chart->driver, $sql);
$group = $settings->group[0]->field;
$groupCount = array();
@@ -2629,7 +2629,7 @@ class screenModel extends model
if($settings and isset($settings->metric))
{
$sql = $this->setFilterSQL($chart);
$results = $this->bi->queryWithDriver($driver, $sql);
$results = $this->bi->queryWithDriver($chart->driver, $sql);
$group = $settings->group[0]->field;
$metrics = array();
+2 -5
View File
@@ -17,13 +17,10 @@ cid=1
- 检查组件是否都被修改。
- 属性card @1
- 属性line @1
- 属性bar @1
- 属性piecircle @1
- 属性pie @1
- 属性radar @1
- 属性funnel @1
- 属性table @1
- 属性baroption @0
- 属性baroption @1
*/
@@ -63,4 +60,4 @@ foreach($componentList as $type => $component)
$checkList[$type] = serialize($clone_componet) != serialize($component);
}
r($checkList) && p('card,line,bar,piecircle,pie,radar,funnel,table,baroption') && e('1,1,1,1,1,1,1,1,0,1,1'); //检查组件是否都被修改。
r($checkList) && p('card,line,piecircle,pie,table,baroption') && e('1,1,1,1,1,1'); //检查组件是否都被修改。
+1 -1
View File
@@ -52,5 +52,5 @@ foreach($components as $component)
isset($componentList['waterpolo']) && $screen->buildWaterPolo($componentList['waterpolo'], $chart);
$waterpolo = $componentList['waterpolo'] ?? null;
r($waterpolo->key) && p('') && e('WaterPolo'); // 测试key
r($waterpolo->chartConfig) && p('chartKey,conKey,title') && e('VWaterPolo,VCWaterPolo,质量数据-Bug密度'); // 测试chartKey,conKey以及标题。
r($waterpolo->chartConfig) && p('chartKey,conKey,title') && e('VWaterPolo,VCWaterPolo,Bug密度'); // 测试chartKey,conKey以及标题。
r($waterpolo && round($waterpolo->option->dataset, 3) == '0.176') && p('') && e('1'); //判断生成的水球图数据是否正确。
@@ -34,6 +34,7 @@ function getComponetAndChart($screen, $filters = array())
$type = $componet->chartConfig->package == 'Tables' ? 'pivot' : 'chart';
$table = $type == 'chart' ? TABLE_CHART : TABLE_PIVOT;
$chart = $tester->dao->select('*')->from($table)->where('id')->eq($componet->sourceID)->fetch();
$componet->option->dataset = new stdclass();
if($chart) return array($componet, $chart);
}
return array(null, null);