* Finish task#54463.

This commit is contained in:
xieqiyu
2022-05-20 12:37:26 +08:00
parent 3c59f5c4a0
commit c07f0dbdab
3 changed files with 24 additions and 0 deletions

View File

@@ -220,6 +220,7 @@ $lang->testcase->resultList['blocked'] = 'Blocked';
$lang->testcase->buttonToList = 'Back';
$lang->testcase->stepsEmpty = 'Case %s step cannot be empty.';
$lang->testcase->errorEncode = 'No data. Please select right encoding and upload again!';
$lang->testcase->noFunction = 'Iconv and mb_convert_encoding are not found. You cannot convert the data to the encoding you want!';
$lang->testcase->noRequire = "Row %s has“%s ”which is a required field and it should not be blank.";

View File

@@ -220,6 +220,7 @@ $lang->testcase->resultList['blocked'] = '阻塞';
$lang->testcase->buttonToList = '返回';
$lang->testcase->stepsEmpty = '用例%s步骤不能为空';
$lang->testcase->errorEncode = '无数据,请选择正确的编码重新上传!';
$lang->testcase->noFunction = '不存在iconv和mb_convert_encoding转码方法不能将数据转成想要的编码';
$lang->testcase->noRequire = "%s行的“%s”是必填字段不能为空";

View File

@@ -39,6 +39,17 @@ class testcaseModel extends model
*/
function create($bugID)
{
$steps = $this->post->steps;
$expects = $this->post->expects;
foreach($expects as $key => $value)
{
if(empty($steps[$key]))
{
dao::$errors[] = sprintf($this->lang->testcase->stepsEmpty, $key);
return false;
}
}
$now = helper::now();
$status = $this->getStatus('create');
$case = fixer::input('post')
@@ -705,6 +716,17 @@ class testcaseModel extends model
*/
public function update($caseID, $testtasks = array())
{
$steps = $this->post->steps;
$expects = $this->post->expects;
foreach($expects as $key => $value)
{
if(empty($steps[$key]))
{
dao::$errors[] = sprintf($this->lang->testcase->stepsEmpty, $key);
return false;
}
}
$now = helper::now();
$oldCase = $this->getById($caseID);