+ Add test case for updateChildrenByParent method.

This commit is contained in:
tianshujie
2023-08-18 10:03:06 +08:00
parent 46248c77a3
commit 267ea7e58d
3 changed files with 62 additions and 1 deletions
+25
View File
@@ -2208,4 +2208,29 @@ class taskTest
return $this->objectModel->dao->select('action')->from(TABLE_ACTION)->where('objectType')->eq('task')->andWhere('objectID')->eq($oldParentTask->id)->orderBy('`id` desc')->fetch();;
}
/**
* 通过父任务更新子任务。
* Update chilren task by parent task.
*
* @param int $parentID
* @param string $action
* @param string $comment
* @access public
* @return object|false
*/
public function updateChildrenByParentTest(int $parentID, string $action, string $comment): object|false
{
$task = $this->objectModel->getByID($parentID);
$data = new stdclass();
$data->name = $task->name;
$data->pri = $task->pri;
$data->status = $task->status;
$this->objectModel->updateChildrenByParent($parentID, $data, $action, $comment);
$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();
}
}