+ Add test case of the cancelparenttask.

This commit is contained in:
tianshujie
2023-08-18 10:28:02 +08:00
parent b3469cd6b2
commit 74c77b18cd
3 changed files with 51 additions and 1 deletions
+24
View File
@@ -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();
}
}