diff --git a/module/aiapp/test/lib/aiapp.unittest.class.php b/module/aiapp/test/lib/aiapp.unittest.class.php index efe343da25..c8e2cb755f 100644 --- a/module/aiapp/test/lib/aiapp.unittest.class.php +++ b/module/aiapp/test/lib/aiapp.unittest.class.php @@ -139,4 +139,18 @@ class aiappTest return $result; } + + /** + * Test getUsedCategoryArray method. + * + * @access public + * @return mixed + */ + public function getUsedCategoryArrayTest() + { + $result = $this->objectModel->getUsedCategoryArray(); + if(dao::isError()) return dao::getError(); + + return $result; + } } \ No newline at end of file diff --git a/module/aiapp/test/model/getusedcategoryarray.php b/module/aiapp/test/model/getusedcategoryarray.php new file mode 100755 index 0000000000..c86cc89435 --- /dev/null +++ b/module/aiapp/test/model/getusedcategoryarray.php @@ -0,0 +1,29 @@ +#!/usr/bin/env php + 工作 +- 执行aiappTest模块的getUsedCategoryArrayTest方法 @) +- 执行aiappTest模块的getUsedCategoryArrayTest方法 @Array + +*/ + +include dirname(__FILE__, 5) . '/test/lib/init.php'; +include dirname(__FILE__, 2) . '/lib/aiapp.unittest.class.php'; + +su('admin'); + +$aiappTest = new aiappTest(); + +r($aiappTest->getUsedCategoryArrayTest()) && p() && e('Array'); +r($aiappTest->getUsedCategoryArrayTest()) && p() && e('('); +r($aiappTest->getUsedCategoryArrayTest()) && p() && e('[work] => 工作'); +r($aiappTest->getUsedCategoryArrayTest()) && p() && e(')'); +r($aiappTest->getUsedCategoryArrayTest()) && p() && e('Array'); \ No newline at end of file diff --git a/module/aiapp/test/model/yaml/ai_miniprogram_getusedcategoryarray.yaml b/module/aiapp/test/model/yaml/ai_miniprogram_getusedcategoryarray.yaml new file mode 100644 index 0000000000..949f79c105 --- /dev/null +++ b/module/aiapp/test/model/yaml/ai_miniprogram_getusedcategoryarray.yaml @@ -0,0 +1,52 @@ +--- +title: 测试 getUsedCategoryArray 方法的小程序数据 +desc: 为 getUsedCategoryArray 方法测试生成 AI 小程序数据 + +fields: +- field: id + range: 1-20 + +- field: name + range: 职业导航{3},工作助手{4},健身计划{4},创意大师{4},文章助手{3},视频脚本{2} + +- field: category + range: work{8},personal{5},life{4},creative{3} + +- field: desc + range: 这是一个AI小程序 + +- field: model + range: 1-5:R + +- field: icon + range: chart-6,writinghand-7,computer-6,notebook-3,palette-3 + +- field: createdBy + range: admin{10},user1{6},user2{4} + +- field: createdDate + range: 2024-01-01 10:00:00-2024-12-31 18:00:00:1D + format: YYYY-MM-DD hh:mm:ss + +- field: editedBy + range: admin{10},user1{6},user2{4} + +- field: editedDate + range: 2024-01-01 10:00:00-2024-12-31 18:00:00:1D + format: YYYY-MM-DD hh:mm:ss + +- field: published + range: '0'{3},'1'{17} + +- field: publishedDate + range: 2024-01-01 10:00:00-2024-12-31 18:00:00:1D,[null]{3} + format: YYYY-MM-DD hh:mm:ss + +- field: deleted + range: '0'{18},'1'{2} + +- field: prompt + range: 请帮助用户完成任务 + +- field: builtIn + range: '0'{15},'1'{5} \ No newline at end of file diff --git a/module/aiapp/test/model/yaml/zt_config_getusedcategoryarray.yaml b/module/aiapp/test/model/yaml/zt_config_getusedcategoryarray.yaml new file mode 100644 index 0000000000..220c68d190 --- /dev/null +++ b/module/aiapp/test/model/yaml/zt_config_getusedcategoryarray.yaml @@ -0,0 +1,25 @@ +--- +title: 测试 getUsedCategoryArray 方法的配置数据 +desc: 为 getUsedCategoryArray 方法测试生成配置表数据 + +fields: +- field: id + range: 21-30 + +- field: vision + range: rnd + +- field: owner + range: system + +- field: module + range: ai + +- field: section + range: miniProgram + +- field: key + range: customCategory1,customCategory2,customCategory3,customCategory4,customCategory5,technical,management,training,testing,tools + +- field: value + range: 自定义分类1,自定义分类2,自定义分类3,自定义分类4,自定义分类5,技术类,管理类,培训类,测试类,工具类 \ No newline at end of file