* [misc] Enhance unit tests for executionTao::processTaskNode() method

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
liugang
2025-09-25 09:16:44 +08:00
co-authored by Claude
parent 8388b3582a
commit cfe9bf6a17
+56 -58
View File
@@ -1,75 +1,73 @@
#!/usr/bin/env php
<?php
/**
title=测试 executionTao::processTaskNode();
timeout=0
cid=0
- 步骤1:有任务的模块节点处理
- 属性type @module
- 属性tasksCount @2
- 步骤2:无任务的模块节点处理
- 属性type @module
- 属性tasksCount @0
- 步骤3:多任务的模块节点处理
- 属性type @module
- 属性tasksCount @3
- 步骤4:另一个无任务模块处理
- 属性type @module
- 属性tasksCount @0
- 步骤5:无效执行ID异常处理 @0
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/execution.unittest.class.php';
$execution = zenData('project');
$execution->id->range('1-5');
$execution->name->range('项目1,项目2,迭代1,迭代2,迭代3');
$execution->type->range('project{2},sprint,stage,kanban');
$execution->id->range('1-6');
$execution->name->range('执行1,执行2,执行3,执行4,执行5,执行6');
$execution->type->range('sprint,stage,kanban,sprint,stage,sprint');
$execution->status->range('doing');
$execution->parent->range('0,0,1,1,2');
$execution->project->range('0,0,1,1,2');
$execution->grade->range('2{2},1{3}');
$execution->openedVersion->range('18.0');
$execution->path->range('1,2,`1,3`,`1,4`,`2,5`')->prefix(',')->postfix(',');
$execution->parent->range('1,1,2,2,3,3');
$execution->project->range('1,1,2,2,3,3');
$execution->grade->range('1');
$execution->path->range('1,`1,2`,`1,3`,`2,4`,`2,5`,`3,6`')->prefix(',')->postfix(',');
$execution->begin->range('20230102 000000:0')->type('timestamp')->format('YY/MM/DD');
$execution->end->range('20230212 000000:0')->type('timestamp')->format('YY/MM/DD');
$execution->gen(5);
$execution->gen(6);
$task = zenData('task');
$task->id->range('1-10');
$task->name->range('1-10')->prefix('任务');
$task->execution->range('3-5');
$task->type->range('test,devel');
$task->status->range('wait,doing');
$task->estimate->range('1-10');
$task->left->range('1-10');
$task->consumed->range('1-10');
$task->gen(10);
$task->id->range('1-12');
$task->name->range('任务1,任务2,任务3,任务4,任务5,任务6,任务7,任务8,任务9,任务10,任务11,任务12');
$task->execution->range('1,1,2,2,2,3,3,3,3,4,4,5');
$task->module->range('1,1,3,3,3,5,5,5,5,7,7,9');
$task->type->range('devel,test,devel,test,devel,test,devel,test,devel,test,devel,test');
$task->status->range('wait,doing,done,wait,doing,done,wait,doing,done,wait,doing,done');
$task->parent->range('0,0,0,0,0,0,0,0,0,0,0,0');
$task->estimate->range('1-8');
$task->left->range('0-5');
$task->consumed->range('1-3');
$task->deleted->range('0');
$task->gen(12);
$product = zenData('product');
$product->id->range('1-3');
$product->name->range('1-3')->prefix('产品');
$product->code->range('1-3')->prefix('product');
$product->type->range('normal');
$product->status->range('normal');
$product->gen(3);
$product = zenData('module');
$product->id->range('1-10');
$product->name->range('1-10')->prefix('模块');
$product->root->range('1-3');
$product->parent->range('0,1{9}');
$product->type->range('task');
$product->gen(10);
$branch = zenData('branch');
$branch->id->range('1-10');
$branch->product->range('1-3');
$branch->gen(5);
$related = zenData('projectproduct');
$related->project->range('3-5');
$related->product->range('1-3');
$related->branch->range('0-1');
$related->gen(5);
$module = zenData('module');
$module->id->range('1-10');
$module->name->range('模块1,模块2,模块3,模块4,模块5,模块6,模块7,模块8,模块9,模块10');
$module->root->range('1,1,2,2,3,3,4,4,5,5');
$module->parent->range('0,1,0,3,0,5,0,7,0,9');
$module->type->range('task');
$module->gen(10);
zenData('team')->gen(0);
su('admin');
/**
$executionTest = new executionTest();
title=测试executionModel->processTaskNode();
timeout=0
cid=1
*/
$executionIDList = array('0', '3', '4', '5');
$execution = new executionTest();
r($execution->processTaskNodeTest($executionIDList[1])) && p('name') && e('产品1'); // 敏捷执行查询
r($execution->processTaskNodeTest($executionIDList[2])) && p('name') && e('产品2'); // 瀑布执行查询
r($execution->processTaskNodeTest($executionIDList[3])) && p('name') && e('产品3'); // 看板执行查询
r($execution->processTaskNodeTest($executionIDList[0])) && p() && e('0'); // 错误执行查询
r($executionTest->processTaskNodeTest(1)) && p('type,tasksCount') && e('module,2'); // 步骤1:有任务的模块节点处理
r($executionTest->processTaskNodeTest(3)) && p('type,tasksCount') && e('module,0'); // 步骤2:无任务的模块节点处理
r($executionTest->processTaskNodeTest(2)) && p('type,tasksCount') && e('module,3'); // 步骤3:多任务的模块节点处理
r($executionTest->processTaskNodeTest(4)) && p('type,tasksCount') && e('module,0'); // 步骤4:另一个无任务模块处理
r($executionTest->processTaskNodeTest(0)) && p() && e('0'); // 步骤5:无效执行ID异常处理