From c8cfd05de53e3d88b841bfea4aeac79cd97df058 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 18 Aug 2025 13:41:26 +0800 Subject: [PATCH] * [unit] Add unit test step for project fetchmembercountbyidlist. --- .../test/tao/fetchmembercountbyidlist.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/module/project/test/tao/fetchmembercountbyidlist.php b/module/project/test/tao/fetchmembercountbyidlist.php index 6b469f8ddc..680f0b5fa6 100644 --- a/module/project/test/tao/fetchmembercountbyidlist.php +++ b/module/project/test/tao/fetchmembercountbyidlist.php @@ -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的情况 \ No newline at end of file