* [unittest] fix buildcomponentlist.

This commit is contained in:
qixinzhi
2025-07-02 03:01:04 +00:00
parent a199be7423
commit 2190ac4312
@@ -15,8 +15,14 @@ cid=1
$screen = new screenTest();
$componentList = $screen->getAllComponent(array('type' => 'line'));
$screenData = $tester->dao->select('*')->from(TABLE_SCREEN)->where('id')->eq(1)->fetch();
$scheme = json_decode($screenData->scheme);
$componentList = $scheme->componentList;
$list = array(current($componentList), '');
r(count($componentList)) && p('') && e('44'); //测试组件列表数量是否正确。
r(count($screen->buildComponentListTest($list))) && p('') && e('1'); //测试带有空元素的情况下,生成的组件列表数量是否正确。
$component = $componentList[0];
r($component->chartConfig->chartKey) && p('') && e('group'); //测试组件类型是否正确。
r($component->id) && p('') && e('5scfjzqsbzo000'); //测试组件id是否正确。
r($component->isGroup) && p('') && e('1'); //测试组件是否为组。
r(isset($component->groupList)) && p('') && e('1'); //测试组件是否为组。