+ [misc] Add unit tests for aiappModel::getUsedCategoryArray() method
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 aiappModel::getUsedCategoryArray();
|
||||
timeout=0
|
||||
cid=0
|
||||
|
||||
- 执行aiappTest模块的getUsedCategoryArrayTest方法 @Array
|
||||
- 执行aiappTest模块的getUsedCategoryArrayTest方法 @(
|
||||
- 执行aiappTest模块的getUsedCategoryArrayTest方法 @[work] => 工作
|
||||
- 执行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');
|
||||
@@ -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}
|
||||
@@ -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,技术类,管理类,培训类,测试类,工具类
|
||||
Reference in New Issue
Block a user