diff --git a/test/class/task.class.php b/test/class/task.class.php index aeb9ab0b64..4142395227 100644 --- a/test/class/task.class.php +++ b/test/class/task.class.php @@ -1029,4 +1029,18 @@ class taskTest return $object; } } + + public function needUpdateBugStatusTest($task) + { + $object = $this->objectModel->needUpdateBugStatus($task); + + if(dao::isError()) + { + return dao::getError(); + } + else + { + return $object ? 1 : 2; + } + } } diff --git a/test/data/zentao/processor.php b/test/data/zentao/processor.php index b6117543f9..26f11f7eb8 100644 --- a/test/data/zentao/processor.php +++ b/test/data/zentao/processor.php @@ -154,7 +154,7 @@ class Processor $parentID = implode(',', $parentIDList); $this->dao->update(TABLE_TASK)->set('parent')->eq(-1)->where('id')->in($parentID)->andWhere('deleted')->eq(0)->exec(); - $this->dao->update(TABLE_TASK)->set('assignedTo')->eq('po82')->set('mailto')->eq('user1,user2,user3')->where('id')->eq(1)->andWhere('deleted')->eq(0)->exec(); + $this->dao->update(TABLE_TASK)->set('assignedTo')->eq('po82')->set('mailto')->eq('user1,user2,user3')->set('frombug')->eq('1')->where('id')->eq(1)->andWhere('deleted')->eq(0)->exec(); } /** diff --git a/test/model/task/needupdatebugstatus.php b/test/model/task/needupdatebugstatus.php new file mode 100755 index 0000000000..a338ee30f7 --- /dev/null +++ b/test/model/task/needupdatebugstatus.php @@ -0,0 +1,31 @@ +#!/usr/bin/env php +needUpdateBugStatus(); +cid=1 +pid=1 + +计算不来源于bug的任务是否需要更新bug状态 >> 2 +计算来源于bug的任务是否需要更新bug状态 bug状态active >> 1 +计算来源于bug的任务是否需要更新bug状态 bug状态resolved >> 2 + +*/ + +$task1 = new stdclass(); +$task1->fromBug = 0; + +$task2 = new stdclass(); +$task2->fromBug = 1; + +$task3 = new stdclass(); +$task3->fromBug = 51; + +$task = new taskTest(); +r($task->needUpdateBugStatusTest($task1)) && p() && e('2'); //计算不来源于bug的任务是否需要更新bug状态 +r($task->needUpdateBugStatusTest($task2)) && p() && e('1'); //计算来源于bug的任务是否需要更新bug状态 bug状态active +r($task->needUpdateBugStatusTest($task3)) && p() && e('2'); //计算来源于bug的任务是否需要更新bug状态 bug状态resolved