* Add task update method unit test.
This commit is contained in:
@@ -12,8 +12,8 @@ cid=1
|
||||
|
||||
- 测试修改任务名称
|
||||
- 第1条的field属性 @name
|
||||
- 第1条的old属性 @开发任务11
|
||||
- 第1条的new属性 @任务名修改
|
||||
- 第1条的old属性 @任务1
|
||||
- 第1条的new属性 @修改后的任务名称
|
||||
|
||||
- 测试无修改 @没有数据更新
|
||||
|
||||
@@ -23,9 +23,9 @@ cid=1
|
||||
- 第0条的new属性 @25
|
||||
|
||||
- 测试修改任务指派人
|
||||
- 第1条的field属性 @assignedTo
|
||||
- 第1条的old属性 @
|
||||
- 第1条的new属性 @user94
|
||||
- 第0条的field属性 @assignedTo
|
||||
- 第0条的old属性 @old3
|
||||
- 第0条的new属性 @user94
|
||||
|
||||
- 测试修改任务类型
|
||||
- 第0条的field属性 @type
|
||||
@@ -44,8 +44,8 @@ cid=1
|
||||
|
||||
- 测试修改任务所属执行
|
||||
- 第0条的field属性 @execution
|
||||
- 第0条的old属性 @107
|
||||
- 第0条的new属性 @101
|
||||
- 第0条的old属性 @7
|
||||
- 第0条的new属性 @8
|
||||
|
||||
- 测试修改任务截止时间
|
||||
- 第0条的field属性 @deadline
|
||||
@@ -53,32 +53,55 @@ cid=1
|
||||
|
||||
- 测试修改任务关闭原因 @ 『关闭原因』必须为空。
|
||||
|
||||
- 测试修改任务的父任务 @当前选中的父任务已有消耗。
|
||||
|
||||
*/
|
||||
|
||||
$execution = zdTable('project');
|
||||
$execution->id->range('1-9');
|
||||
$execution->name->prefix('执行')->range('1-9');
|
||||
$execution->type->range('sprint{4},kanban{2},stage{3}');
|
||||
$execution->parent->range('0');
|
||||
$execution->path->range('1-9');
|
||||
$execution->status->range('doing');
|
||||
$execution->openedBy->range('admin,user1');
|
||||
$execution->begin->range('(-3M)-(+M):1D')->type('timestamp')->format('YY/MM/DD');
|
||||
$execution->end->range('(+5w)-(+2M):1D')->type('timestamp')->format('YY/MM/DD');
|
||||
$execution->gen(9);
|
||||
|
||||
$task = zdTable('task');
|
||||
$task->id->range('1-9');
|
||||
$task->execution->range('1-9');
|
||||
$task->name->prefix("任务")->range('1-9');
|
||||
$task->left->range('0-8');
|
||||
$task->estStarted->range('2022\-01\-01');
|
||||
$task->assignedTo->prefix("old")->range('1-9');
|
||||
$task->status->range("wait,doing,done,pause,cancel,closed");
|
||||
$task->gen(9);
|
||||
|
||||
$deadline = '2022-03-29';
|
||||
$taskIDList = array('1','2','3','4','5','6','7','8','9');
|
||||
|
||||
$changename = array('name' => '任务名修改','deadline' => $deadline);
|
||||
$changename = array('name' => '修改后的任务名称','deadline' => $deadline);
|
||||
$changemodule = array('module' => '25');
|
||||
$changeassign = array('assignedTo' => 'user94');
|
||||
$changetype = array('type' => 'devel');
|
||||
$changestatus = array('status' => 'doing');
|
||||
$changepri = array('pri' => '1');
|
||||
$changeexecution = array('execution' => '101');
|
||||
$changeexecution = array('execution' => '8');
|
||||
$changedeadline = array('deadline' => $deadline);
|
||||
$ckclosedReason = array('closedReason' => '关闭原因');
|
||||
|
||||
$today = helper::today();
|
||||
$oldDeadline = $dao->select("date_sub('$today', interval 1 day) as date")->fetch()->date;
|
||||
$closedReason = array('closedReason' => '关闭原因');
|
||||
$changeParent = array('parent' => '1');
|
||||
|
||||
$task = new taskTest();
|
||||
r($task->updateObject($taskIDList[0], $changename)) && p('1:field,old,new') && e('name,开发任务11,任务名修改'); // 测试修改任务名称
|
||||
r($task->updateObject($taskIDList[0], $changename)) && p() && e('没有数据更新'); // 测试无修改
|
||||
r($task->updateObject($taskIDList[1], $changemodule)) && p('0:field,old,new') && e('module,24,25'); // 测试修改任务模块
|
||||
r($task->updateObject($taskIDList[2], $changeassign)) && p('1:field,old,new') && e('assignedTo,,user94'); // 测试修改任务指派人
|
||||
r($task->updateObject($taskIDList[3], $changetype)) && p('0:field,old,new') && e('type,study,devel'); // 测试修改任务类型
|
||||
r($task->updateObject($taskIDList[4], $changestatus)) && p('0:field,old,new') && e('status,cancel,doing'); // 测试修改任务状态
|
||||
r($task->updateObject($taskIDList[5], $changepri)) && p('0:field,old,new') && e('pri,2,1'); // 测试修改任务优先级
|
||||
r($task->updateObject($taskIDList[6], $changeexecution)) && p('0:field,old,new') && e('execution,107,101'); // 测试修改任务所属执行
|
||||
r($task->updateObject($taskIDList[8], $changedeadline)) && p('0:field,new') && e("deadline,2022-03-29"); // 测试修改任务截止时间
|
||||
r($task->updateObject($taskIDList[0], $ckclosedReason)) && p('closedReason:0') && e(' 『关闭原因』必须为空。'); // 测试修改任务关闭原因
|
||||
r($task->updateObject($taskIDList[0], $changename)) && p('1:field,old,new') && e('name,任务1,修改后的任务名称'); // 测试修改任务名称
|
||||
r($task->updateObject($taskIDList[0], $changename)) && p() && e('没有数据更新'); // 测试无修改
|
||||
r($task->updateObject($taskIDList[1], $changemodule)) && p('0:field,old,new') && e('module,24,25'); // 测试修改任务模块
|
||||
r($task->updateObject($taskIDList[2], $changeassign)) && p('0:field,old,new') && e('assignedTo,old3,user94'); // 测试修改任务指派人
|
||||
r($task->updateObject($taskIDList[3], $changetype)) && p('0:field,old,new') && e('type,study,devel'); // 测试修改任务类型
|
||||
r($task->updateObject($taskIDList[4], $changestatus)) && p('0:field,old,new') && e('status,cancel,doing'); // 测试修改任务状态
|
||||
r($task->updateObject($taskIDList[5], $changepri)) && p('0:field,old,new') && e('pri,2,1'); // 测试修改任务优先级
|
||||
r($task->updateObject($taskIDList[6], $changeexecution)) && p('0:field,old,new') && e('execution,7,8'); // 测试修改任务所属执行
|
||||
r($task->updateObject($taskIDList[8], $changedeadline)) && p('0:field,new') && e("deadline,2022-03-29"); // 测试修改任务截止时间
|
||||
r($task->updateObject($taskIDList[0], $closedReason)) && p('closedReason:0') && e(' 『关闭原因』必须为空。'); // 测试修改任务关闭原因
|
||||
r($task->updateObject($taskIDList[8], $changeParent)[0]) && p() && e('当前选中的父任务已有消耗。'); // 测试修改任务的父任务
|
||||
Reference in New Issue
Block a user