+ Add test case of the cancelparenttask.
This commit is contained in:
@@ -2233,4 +2233,28 @@ class taskTest
|
||||
$childID = $this->objectModel->dao->select('id')->from(TABLE_TASK)->where('parent')->eq($parentID)->fetch('id');
|
||||
return $this->objectModel->dao->select('action')->from(TABLE_ACTION)->where('objectType')->eq('task')->andWhere('objectID')->eq($childID)->orderBy('id_desc')->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消父任务更新子任务。。
|
||||
* Update a child task when cancel its parent task.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @access public
|
||||
* @return object|false
|
||||
*/
|
||||
public function cancelParentTaskTest(int $taskID): object|false
|
||||
{
|
||||
$task = $this->objectModel->getByID($taskID);
|
||||
|
||||
$data = new stdclass();
|
||||
$data->id = $task->id;
|
||||
$data->name = $task->name;
|
||||
$data->pri = $task->pri;
|
||||
$data->status = $task->status;
|
||||
$data->execution = $task->execution;
|
||||
$this->objectModel->cancelParentTask($data);
|
||||
|
||||
$childID = $this->objectModel->dao->select('id')->from(TABLE_TASK)->where('parent')->eq($taskID)->fetch('id');
|
||||
return $this->objectModel->dao->select('action')->from(TABLE_ACTION)->where('objectType')->eq('task')->andWhere('objectID')->eq($childID)->orderBy('id_desc')->fetch();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user