- [misc] Remove useless unit test scripts generated by Claude Code.

This commit is contained in:
liugang
2026-01-08 08:22:08 +08:00
parent 3af7b4c93d
commit 85e402d39e
5 changed files with 0 additions and 396 deletions
@@ -1,49 +0,0 @@
#!/usr/bin/env php
<?php
/**
title=测试 executionZen::processPrintKanbanData();
timeout=0
cid=16438
- 步骤1:有历史数据时过滤重复项目
- 属性wait @3
- 属性doing @2
- 步骤2:无历史数据时返回原始数据
- 属性wait @2
- 属性doing @1
- 步骤3:空数据列表返回0 @0
- 步骤4:历史数据存在但无重复时返回原数据
- 属性wait @2
- 属性doing @1
- 步骤5:多类型数据重复被全部移除
- 属性story @2
- 属性bug @2
*/
// 1. 导入依赖(路径固定,不可修改)
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/executionzen.unittest.class.php';
// 2. 手动数据准备(设置历史看板数据)
global $tester;
$settingModel = $tester->loadModel('setting');
$settingModel->setItem('owner=null&module=execution&section=kanban&key=execution1', '{"wait":["1","2"],"doing":["3"],"done":["4","5"]}');
$settingModel->setItem('owner=null&module=execution&section=kanban&key=execution2', '{"story":["101","102"],"bug":["201","202"]}');
$settingModel->setItem('owner=null&module=execution&section=kanban&key=execution3', '{"task":["301","302","303"],"story":["104"]}');
$settingModel->setItem('owner=null&module=execution&section=kanban&key=execution4', '{"wait":["6","7","8"],"doing":["9"]}');
// 3. 用户登录(选择合适角色)
su('admin');
// 4. 创建测试实例(变量名与模块名一致)
$executionTest = new executionZenTest();
// 5. 🔴 强制要求:必须包含至少5个测试步骤
r($executionTest->processPrintKanbanDataTest(1, array('wait' => array('1' => 'task1', '2' => 'task2', '10' => 'task10'), 'doing' => array('3' => 'task3', '11' => 'task11')))) && p('wait,doing') && e('3,2'); // 步骤1:有历史数据时过滤重复项目
r($executionTest->processPrintKanbanDataTest(999, array('wait' => array('1' => 'task1', '2' => 'task2'), 'doing' => array('3' => 'task3')))) && p('wait,doing') && e('2,1'); // 步骤2:无历史数据时返回原始数据
r($executionTest->processPrintKanbanDataTest(1, array())) && p() && e('0'); // 步骤3:空数据列表返回0
r($executionTest->processPrintKanbanDataTest(1, array('wait' => array('20' => 'task20', '21' => 'task21'), 'doing' => array('22' => 'task22')))) && p('wait,doing') && e('2,1'); // 步骤4:历史数据存在但无重复时返回原数据
r($executionTest->processPrintKanbanDataTest(2, array('story' => array('101' => 'story101', '103' => 'story103'), 'bug' => array('201' => 'bug201', '203' => 'bug203')))) && p('story,bug') && e('2,2'); // 步骤5:多类型数据重复被全部移除
@@ -1,69 +0,0 @@
#!/usr/bin/env php
<?php
/**
title=测试 executionZen::setUserMoreLink();
timeout=0
cid=16445
- 应返回4个用户列表数组 @4
- 应返回4个用户列表数组 @4
- 应返回4个数组(但内容为空) @4
- 应返回4个数组(但内容为空) @4
- 应返回4个用户列表数组,重复用户会被处理 @4
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/executionzen.unittest.class.php';
// 准备测试数据
zenData('user')->gen(10);
zenData('project')->gen(5);
// 用户登录
su('admin');
// 创建测试实例
$executionZenTest = new executionZenTest();
// 测试步骤1:传入单个执行对象,获取用户列表
$execution1 = new stdClass();
$execution1->PO = 'admin';
$execution1->PM = 'user1';
$execution1->QD = 'user2';
$execution1->RD = 'user3';
$result1 = $executionZenTest->setUserMoreLinkTest($execution1);
r(count($result1)) && p() && e(4); // 应返回4个用户列表数组
// 测试步骤2:传入执行对象数组,获取用户列表
$execution2 = new stdClass();
$execution2->PO = 'user4';
$execution2->PM = 'user5';
$execution2->QD = 'user6';
$execution2->RD = 'user7';
$executionArray = array($execution1, $execution2);
$result2 = $executionZenTest->setUserMoreLinkTest($executionArray);
r(count($result2)) && p() && e(4); // 应返回4个用户列表数组
// 测试步骤3:传入null参数,获取空用户列表
$result3 = $executionZenTest->setUserMoreLinkTest(null);
r(count($result3)) && p() && e(4); // 应返回4个数组(但内容为空)
// 测试步骤4:传入空数组,获取空用户列表
$result4 = $executionZenTest->setUserMoreLinkTest(array());
r(count($result4)) && p() && e(4); // 应返回4个数组(但内容为空)
// 测试步骤5:传入包含重复用户的执行对象数组
$execution3 = new stdClass();
$execution3->PO = 'admin'; // 重复用户
$execution3->PM = 'user1'; // 重复用户
$execution3->QD = 'user8';
$execution3->RD = 'user9';
$executionArrayDup = array($execution1, $execution3);
$result5 = $executionZenTest->setUserMoreLinkTest($executionArrayDup);
r(count($result5)) && p() && e(4); // 应返回4个用户列表数组,重复用户会被处理
@@ -1,50 +0,0 @@
#!/usr/bin/env php
<?php
/**
title=测试 executionZen::setUserMoreLink();
timeout=0
cid=16447
- 步骤1:传入execution对象数组第0条的pm1属性 @P:项目经理1
- 步骤2:传入单个execution对象第0条的pm1属性 @P:项目经理1
- 步骤3:传入null参数,验证返回数组长度 @4
- 步骤4:传入空数组,验证返回数组长度 @4
- 步骤5:验证PO用户获取第1条的po1属性 @P:产品经理1
*/
// 1. 导入依赖(路径固定,不可修改)
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/executionzen.unittest.class.php';
// 2. zendata数据准备(根据需要配置)
$user = zenData('user');
$user->account->range('admin,pm1,pm2,po1,po2,qd1,qd2,rd1,rd2,dev1');
$user->realname->range('管理员,项目经理1,项目经理2,产品经理1,产品经理2,测试主管1,测试主管2,研发主管1,研发主管2,开发1');
$user->role->range('admin{1},pm{2},po{2},qd{2},rd{2},dev{1}');
$user->deleted->range('0');
$user->gen(10);
$project = zenData('project');
$project->id->range('1-5');
$project->name->range('项目1,项目2,项目3,项目4,项目5');
$project->type->range('sprint');
$project->parent->range('0');
$project->status->range('doing');
$project->deleted->range('0');
$project->gen(5);
// 3. 用户登录(选择合适角色)
su('admin');
// 4. 创建测试实例(变量名与模块名一致)
$executionTest = new executionZenTest();
// 5. 强制要求:必须包含至少5个测试步骤
r($executionTest->setUserMoreLinkTest(array((object)array('PO' => 'po1', 'PM' => 'pm1', 'QD' => 'qd1', 'RD' => 'rd1'), (object)array('PO' => 'po2', 'PM' => 'pm2', 'QD' => 'qd2', 'RD' => 'rd2')))) && p('0:pm1') && e('P:项目经理1'); // 步骤1:传入execution对象数组
r($executionTest->setUserMoreLinkTest((object)array('PO' => 'po1', 'PM' => 'pm1', 'QD' => 'qd1', 'RD' => 'rd1'))) && p('0:pm1') && e('P:项目经理1'); // 步骤2:传入单个execution对象
r(count($executionTest->setUserMoreLinkTest(null))) && p() && e('4'); // 步骤3:传入null参数,验证返回数组长度
r(count($executionTest->setUserMoreLinkTest(array()))) && p() && e('4'); // 步骤4:传入空数组,验证返回数组长度
r($executionTest->setUserMoreLinkTest((object)array('PO' => 'po1', 'PM' => 'pm1', 'QD' => 'qd1', 'RD' => 'rd1'))) && p('1:po1') && e('P:产品经理1'); // 步骤5:验证PO用户获取
-129
View File
@@ -1,129 +0,0 @@
#!/usr/bin/env php
<?php
/**
title=测试 kanbanTao::getERURCardMenu();
timeout=0
cid=16977
- 步骤1:正常执行ID和空对象数组 @0
- 步骤2:正常执行ID和包含单个需求对象的数组 @1
- 步骤3:正常执行ID和包含多个需求对象的数组 @3
- 步骤4:不存在的执行ID和对象数组 @1
- 步骤5:包含不同状态和类型需求的对象数组 @2
*/
// 1. 导入依赖(路径固定,不可修改)
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/kanban.unittest.class.php';
// 2. zendata数据准备(根据需要配置)
$story = zenData('story');
$story->id->range('1-10');
$story->product->range('1-3');
$story->title->range('用需求1,业需求1,父需求1,需求标题4,需求标题5,需求标题6,需求标题7,需求标题8,需求标题9,需求标题10');
$story->type->range('epic{2},requirement{3},story{5}');
$story->status->range('active{7},draft{2},closed{1}');
$story->stage->range('wait{3},projected{2},developing{3},testing{2}');
$story->pri->range('1-4');
$story->estimate->range('1-10');
$story->openedBy->range('admin,user1,user2,user3');
$story->assignedTo->range('admin,user1,user2,user3,closed');
$story->version->range('1');
$story->deleted->range('0');
$story->isParent->range('0{8},1{2}');
$story->gen(10);
$execution = zenData('project');
$execution->id->range('101-103');
$execution->name->range('执行1,执行2,执行3');
$execution->type->range('execution');
$execution->status->range('doing');
$execution->hasProduct->range('1');
$execution->deleted->range('0');
$execution->gen(3);
$projectStory = zenData('projectstory');
$projectStory->project->range('101,102,103');
$projectStory->story->range('1-3,4-6,7-9');
$projectStory->version->range('1');
$projectStory->gen(9);
$user = zenData('user');
$user->id->range('1-5');
$user->account->range('admin,user1,user2,user3,closed');
$user->realname->range('管理员,用户1,用户2,用户3,已关闭');
$user->password->range('123456');
$user->role->range('admin,dev,qa,pm,td');
$user->deleted->range('0{4},1{1}');
$user->gen(5);
// 3. 用户登录(选择合适角色)
su('admin');
// 4. 创建测试实例(变量名与模块名一致)
$kanbanTest = new kanbanTest();
// 5. 强制要求:必须包含至少5个测试步骤
r($kanbanTest->getERURCardMenuTest(101, array())) && p() && e('0'); // 步骤1:正常执行ID和空对象数组
$story1 = new stdclass();
$story1->id = 1;
$story1->type = 'epic';
$story1->status = 'active';
$story1->title = '用需求1';
$story1->stage = 'wait';
$story1->assignedTo = 'admin';
$story1->version = 1;
$story1->deleted = '0';
$story1->story = 1;
r($kanbanTest->getERURCardMenuTest(101, array($story1))) && p() && e('1'); // 步骤2:正常执行ID和包含单个需求对象的数组
$story2 = new stdclass();
$story2->id = 2;
$story2->type = 'requirement';
$story2->status = 'active';
$story2->title = '业需求1';
$story2->stage = 'projected';
$story2->assignedTo = 'user1';
$story2->version = 1;
$story2->deleted = '0';
$story2->story = 2;
$story3 = new stdclass();
$story3->id = 3;
$story3->type = 'story';
$story3->status = 'active';
$story3->title = '父需求1';
$story3->stage = 'developing';
$story3->assignedTo = 'user2';
$story3->version = 1;
$story3->deleted = '0';
$story3->story = 3;
r($kanbanTest->getERURCardMenuTest(101, array($story1, $story2, $story3))) && p() && e('3'); // 步骤3:正常执行ID和包含多个需求对象的数组
r($kanbanTest->getERURCardMenuTest(999, array($story1))) && p() && e('1'); // 步骤4:不存在的执行ID和对象数组
$storyDraft = new stdclass();
$storyDraft->id = 4;
$storyDraft->type = 'story';
$storyDraft->status = 'draft';
$storyDraft->title = 'draft状态的需求';
$storyDraft->stage = 'wait';
$storyDraft->assignedTo = 'admin';
$storyDraft->story = 4;
$storyClosed = new stdclass();
$storyClosed->id = 5;
$storyClosed->type = 'requirement';
$storyClosed->status = 'closed';
$storyClosed->title = 'closed状态的需求';
$storyClosed->stage = 'closed';
$storyClosed->assignedTo = 'closed';
$storyClosed->story = 5;
r($kanbanTest->getERURCardMenuTest(101, array($storyDraft, $storyClosed))) && p() && e('2'); // 步骤5:包含不同状态和类型需求的对象数组
@@ -1,99 +0,0 @@
#!/usr/bin/env php
<?php
/**
title=测试 kanbanTao::getERURCardMenu();
timeout=0
cid=16981
- 步骤1:正常执行ID和空对象数组 @0
- 步骤2:正常执行ID和包含需求对象的数组 @2
- 步骤3:不存在的执行ID和对象数组 @1
- 步骤4:执行ID为0和对象数组 @1
- 步骤5:draft状态的需求 @1
*/
// 1. 导入依赖(路径固定,不可修改)
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/kanban.unittest.class.php';
// 2. zendata数据准备(根据需要配置)
$story = zenData('story');
$story->id->range('1-10');
$story->product->range('1-3');
$story->title->range('用需求1,业需求1,父需求1,需求标题4,需求标题5,需求标题6,需求标题7,需求标题8,需求标题9,需求标题10');
$story->type->range('epic{2},requirement{3},story{5}');
$story->status->range('active{5},draft{2},reviewing{2},closed{1}');
$story->stage->range('wait{3},projected{2},developing{3},testing{2}');
$story->pri->range('1-4');
$story->estimate->range('1-10');
$story->openedBy->range('admin,user1,user2,user3');
$story->assignedTo->range('admin,user1,user2,user3,closed');
$story->version->range('1');
$story->deleted->range('0');
$story->gen(10);
$execution = zenData('project');
$execution->id->range('101-103');
$execution->name->range('执行1,执行2,执行3');
$execution->type->range('execution');
$execution->status->range('doing');
$execution->hasProduct->range('1');
$execution->deleted->range('0');
$execution->gen(3);
$projectStory = zenData('projectstory');
$projectStory->project->range('101,102,103');
$projectStory->story->range('1-3,4-6,7-9');
$projectStory->version->range('1');
$projectStory->gen(9);
// 3. 用户登录(选择合适角色)
su('admin');
// 4. 创建测试实例(变量名与模块名一致)
$kanbanTest = new kanbanTest();
// 5. 强制要求:必须包含至少5个测试步骤
r($kanbanTest->getERURCardMenuTest(101, array())) && p() && e('0'); // 步骤1:正常执行ID和空对象数组
$story1 = new stdclass();
$story1->id = 1;
$story1->type = 'epic';
$story1->status = 'active';
$story1->title = '用需求1';
$story1->stage = 'wait';
$story1->assignedTo = 'admin';
$story1->version = 1;
$story1->deleted = '0';
$story1->story = 1;
$story2 = new stdclass();
$story2->id = 2;
$story2->type = 'requirement';
$story2->status = 'active';
$story2->title = '业需求1';
$story2->stage = 'projected';
$story2->assignedTo = 'user1';
$story2->version = 1;
$story2->deleted = '0';
$story2->story = 2;
r($kanbanTest->getERURCardMenuTest(101, array($story1, $story2))) && p() && e('2'); // 步骤2:正常执行ID和包含需求对象的数组
r($kanbanTest->getERURCardMenuTest(999, array($story1))) && p() && e('1'); // 步骤3:不存在的执行ID和对象数组
r($kanbanTest->getERURCardMenuTest(0, array($story1))) && p() && e('1'); // 步骤4:执行ID为0和对象数组
$storyDraft = new stdclass();
$storyDraft->id = 3;
$storyDraft->type = 'story';
$storyDraft->status = 'draft';
$storyDraft->title = 'draft状态的需求';
$storyDraft->stage = 'wait';
$storyDraft->assignedTo = 'admin';
$storyDraft->story = 3;
r($kanbanTest->getERURCardMenuTest(101, array($storyDraft))) && p() && e('1'); // 步骤5:draft状态的需求