From acfda5d6897be210294651eefbc82eccc57f66e7 Mon Sep 17 00:00:00 2001 From: sunguangming Date: Wed, 20 Dec 2023 15:04:54 +0800 Subject: [PATCH] * Modify unit test. --- module/kanban/model.php | 2 +- module/kanban/test/model/batchcreatecard.php | 4 ++-- module/kanban/test/tao/updatecolumnsort.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/kanban/model.php b/module/kanban/model.php index 0d085f752d..292c124216 100755 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -665,7 +665,7 @@ class kanbanModel extends model $card->assignedDate = $now; $card->color = '#fff'; - $this->dao->insert(TABLE_KANBANCARD)->data($card)->autoCheck() + $this->dao->insert(TABLE_KANBANCARD)->data($card, 'lane')->autoCheck() ->checkIF($card->estimate != '', 'estimate', 'float') ->batchCheck($this->config->kanban->createcard->requiredFields, 'notempty') ->exec(); diff --git a/module/kanban/test/model/batchcreatecard.php b/module/kanban/test/model/batchcreatecard.php index cb7eab9287..52a58453f4 100755 --- a/module/kanban/test/model/batchcreatecard.php +++ b/module/kanban/test/model/batchcreatecard.php @@ -18,7 +18,7 @@ cid=1 - 属性column @1 - 属性lane @1 - 属性type @common - - 属性cards @,0,1,2,801, + - 属性cards @,2,1,2,801, - 批量创建卡片,其中一个没有名称第name条的0属性 @『卡片名称』不能为空。 - 批量创建卡片 预计为负数属性estimate[1] @预计不能为负数! - 批量创建卡片 开始时间大于结束时间属性end[1] @"截止日期"不能小于"预计开始"! @@ -75,7 +75,7 @@ $cards4[] = $beginGtEnd; $kanban = new kanbanTest(); -r($kanban->batchCreateCardTest($cards1)) && p('kanban|column|lane|type|cards', '|') && e('1|1|1|common|,0,1,2,801,'); // 批量创建正常的卡片 +r($kanban->batchCreateCardTest($cards1)) && p('kanban|column|lane|type|cards', '|') && e('1|1|1|common|,2,1,2,801,'); // 批量创建正常的卡片 r($kanban->batchCreateCardTest($cards2)) && p('name:0') && e('『卡片名称』不能为空。'); // 批量创建卡片,其中一个没有名称 r($kanban->batchCreateCardTest($cards3)) && p('estimate[1]') && e('预计不能为负数!'); // 批量创建卡片 预计为负数 r($kanban->batchCreateCardTest($cards4)) && p('end[1]') && e('"截止日期"不能小于"预计开始"!'); // 批量创建卡片 开始时间大于结束时间 \ No newline at end of file diff --git a/module/kanban/test/tao/updatecolumnsort.php b/module/kanban/test/tao/updatecolumnsort.php index 02cb99797c..4515ddb719 100755 --- a/module/kanban/test/tao/updatecolumnsort.php +++ b/module/kanban/test/tao/updatecolumnsort.php @@ -44,4 +44,4 @@ r($columns) && p('1,2,3,4') && e('4,3,2,1'); // 查看更新之后的排序 $columnIDList = array('201', '202'); $tester->loadModel('kanban')->updatecolumnSort(1, $columnIDList); $columns = $tester->dao->select('id, `order`')->from(TABLE_KANBANCOLUMN)->where('region')->eq('1')->fetchPairs(); -r($columns) && p('1,2,3,4') && e('4,3,2,1'); // 更新不存在的ID,排序不变 +r($columns) && p('1,2,3,4') && e('4,3,2,1'); // 更新不存在的ID,排序不变 \ No newline at end of file