* [unit] Add unit test step for project fetchmembercountbyidlist.

This commit is contained in:
wangyidong
2025-08-21 08:38:52 +08:00
committed by tianshujie
parent 71ebaa36cf
commit c8cfd05de5
@@ -28,19 +28,29 @@ zenData('user')->gen(10);
/**
title=测试 projectModel::fetchProjectList();
title=测试 projectModel::fetchMemberCountByIdList();
timeout=0
cid=1
- 查询没有项目ID的情况 @0
- 查询错误ID的情况 @0
- 查询正常ID的情况
- 属性11 @1
- 属性12 @1
- 属性13 @1
- 查询不存在ID的情况 @0
*/
$noneIDList = array();
$wrongIDList = array('1', '2');
$realIDList = array('11', '12');
$realIDList = array('11', '12', '13', '1');
global $tester;
$projectTester = $tester->loadModel('project');
r($projectTester->fetchMemberCountByIdList($noneIDList)) && p() && e('0'); // 查询没有项目ID的情况
r($projectTester->fetchMemberCountByIdList($wrongIDList)) && p() && e('0'); // 查询错误ID的情况
r($projectTester->fetchMemberCountByIdList($realIDList)) && p('11') && e('1'); // 查询正常ID的情况
$memberCount = $projectTester->fetchMemberCountByIdList($realIDList);
r($memberCount) && p('11,12,13') && e('1,1,1'); // 查询正常ID的情况
r(isset($memberCount[1])) && p() && e('0'); // 查询不存在ID的情况