From aa30b979131c03b00ad17136ee802a4d99082093 Mon Sep 17 00:00:00 2001 From: daitingting Date: Mon, 8 May 2023 01:38:39 +0000 Subject: [PATCH] * Update test of update. --- module/bug/test/bug.class.php | 1 - module/bug/test/model/update.php | 20 ++++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/module/bug/test/bug.class.php b/module/bug/test/bug.class.php index 4406979f52..084419b479 100644 --- a/module/bug/test/bug.class.php +++ b/module/bug/test/bug.class.php @@ -795,7 +795,6 @@ class bugTest $_POST[$field] = $value; } } - //$_POST['closedDate'] = ''; $_POST['deleteFiles'] = array(); $object->files = array(); diff --git a/module/bug/test/model/update.php b/module/bug/test/model/update.php index eb684be340..a2601b1843 100755 --- a/module/bug/test/model/update.php +++ b/module/bug/test/model/update.php @@ -1,6 +1,7 @@ #!/usr/bin/env php update(); timeout=0 cid=1 -- 执行bug模块的updateObject方法,参数是$bugIdList[0], $t_uptitle +- 测试更新bug名称 - 第0条的field属性 @title - 第0条的old属性 @BUG1 - 第0条的new属性 @john -- 执行bug模块的updateObject方法,参数是$bugIdList[0], $t_uptype +- 测试更新bug类型 - 第0条的field属性 @type - 第0条的old属性 @codeerror - 第0条的new属性 @config -- 执行bug模块的updateObject方法,参数是$bugIdList[0], $t_untitle @没有数据更新 +- 测试不更改bug名称 @没有数据更新 -- 执行bug模块的updateObject方法,参数是$bugIdList[0], $t_untype @没有数据更新 +- 测试不更改bug类型 @没有数据更新 @@ -54,9 +55,8 @@ $t_uptype = array('type' => 'config'); $t_untitle = array('title' => 'john'); $t_untype = array('type' => 'config'); -global $tester; -$tester->loadModel('bug'); -r($tester->bug->updateObject($bugIdList[0], $t_uptitle)) && p('0:field,old,new') && e('title,BUG1,john'); // 测试更新bug名称 -r($tester->bug->updateObject($bugIdList[0], $t_uptype)) && p('0:field,old,new') && e('type,codeerror,config'); // 测试更新bug类型 -r($tester->bug->updateObject($bugIdList[0], $t_untitle)) && p() && e('没有数据更新'); // 测试不更改bug名称 -r($tester->bug->updateObject($bugIdList[0], $t_untype)) && p() && e('没有数据更新'); // 测试不更改bug类型 +$bug = new bugTest(); +r($bug->updateObject($bugIdList[0], $t_uptitle)) && p('0:field,old,new') && e('title,BUG1,john'); // 测试更新bug名称 +r($bug->updateObject($bugIdList[0], $t_uptype)) && p('0:field,old,new') && e('type,codeerror,config'); // 测试更新bug类型 +r($bug->updateObject($bugIdList[0], $t_untitle)) && p() && e('没有数据更新'); // 测试不更改bug名称 +r($bug->updateObject($bugIdList[0], $t_untype)) && p() && e('没有数据更新'); // 测试不更改bug类型 \ No newline at end of file