From ee85fc63fb9005555b5a104079e0235abd186ac8 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 29 Aug 2023 15:14:06 +0800 Subject: [PATCH] * Refactor testcase::confirmChange. --- module/testcase/control.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/module/testcase/control.php b/module/testcase/control.php index 9d169b563d..52519f93b1 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -816,19 +816,20 @@ class testcase extends control } /** + * 确认用例变更。 * Confirm testcase changed. * * @param int $caseID * @param int $taskID - * @param string $from + * @param string $from view|list * @access public * @return void */ - public function confirmChange($caseID, $taskID = 0, $from = 'view') + public function confirmChange(int $caseID, int $taskID = 0, string $from = 'view') { $case = $this->testcase->getById($caseID); $this->dao->update(TABLE_TESTRUN)->set('version')->eq($case->version)->where('`case`')->eq($caseID)->exec(); - return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'load' => $from == 'view' ? inlink('view', "caseID=$caseID&version=$case->version&from=testtask&taskID=$taskID") : true)); + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'load' => $from == 'view' ? inlink('view', "caseID={$caseID}&version={$case->version}&from=testtask&taskID={$taskID}") : true)); } /**