From 93b37e12962df6c4a79c6cccca0b201c2f11efce Mon Sep 17 00:00:00 2001 From: jukui Date: Mon, 8 May 2023 09:09:10 +0800 Subject: [PATCH] + Add getlistby function test case and fix model test case for todo tao. --- .../test/model/getselfandchildrenlist.php | 2 ++ module/programplan/test/model/getsiblings.php | 3 +- module/todo/test/model/getbyexportlist.php | 2 ++ module/todo/test/model/getlist.php | 13 +++++--- module/todo/test/tao/getlistby.php | 32 +++++++++++++++++++ .../test/tao/yaml/getlistby/getlistby.yaml | 24 ++++++++++++++ 6 files changed, 70 insertions(+), 6 deletions(-) create mode 100644 module/todo/test/tao/getlistby.php create mode 100644 module/todo/test/tao/yaml/getlistby/getlistby.yaml diff --git a/module/programplan/test/model/getselfandchildrenlist.php b/module/programplan/test/model/getselfandchildrenlist.php index 991c2cea60..7da68b75a0 100755 --- a/module/programplan/test/model/getselfandchildrenlist.php +++ b/module/programplan/test/model/getselfandchildrenlist.php @@ -1,5 +1,7 @@ #!/usr/bin/env php gen(5); su('admin'); /** diff --git a/module/todo/test/model/getbyexportlist.php b/module/todo/test/model/getbyexportlist.php index 8f82b47e4f..870111877f 100644 --- a/module/todo/test/model/getbyexportlist.php +++ b/module/todo/test/model/getbyexportlist.php @@ -1,5 +1,7 @@ #!/usr/bin/env php getListTest($typeList[2]) == $thisWeekNum ? '1' : '0'; -$lastweek = $todo->getListTest($typeList[3]) == $lastWeekNum ? '1' : '0'; -$thismonth = $todo->getListTest($typeList[4]) == $thisMonthNum ? '1' : '0'; -$lastmonth = $todo->getListTest($typeList[5]) == $lastMonthNum ? '1' : '0'; +$thisweek = $todo->getListTest($typeList[2]) == $thisWeekNum ? '1' : '0'; +$lastweek = $todo->getListTest($typeList[3]) == $lastWeekNum ? '1' : '0'; +$thismonth = $todo->getListTest($typeList[4]) == $thisMonthNum ? '1' : '0'; +$lastmonth = $todo->getListTest($typeList[5]) == $lastMonthNum ? '1' : '0'; $thisSeason = $todo->getListTest($typeList[6]) == $thisSeasonNum ? '1' : '0'; r($thisweek) && p() && e('1'); // 获取type为thisweek 当前用户的代办数量 diff --git a/module/todo/test/tao/getlistby.php b/module/todo/test/tao/getlistby.php new file mode 100644 index 0000000000..ae7922e455 --- /dev/null +++ b/module/todo/test/tao/getlistby.php @@ -0,0 +1,32 @@ +#!/usr/bin/env php +config('getlistby')->gen(5); + +/** + +title=测试 todoModel->getListBy(); +cid=1 +pid=0 + +*/ + +global $tester; +$tester->loadModel('todo')->todoTao; + + +$type = 'before'; +$account = 'admin'; +$status = 'all'; +$begin = '2021-02-03'; +$end = '2024-04-04'; +$limit = 5; +$orderBy = 'date_desc'; + +$result = $tester->todo->getListBy($type, $account, $status, $begin, $end, $limit, $orderBy); + +r(count($result)) && p() && e('5'); +r($result[0]) && p('name,status') && e('待办5,doing'); diff --git a/module/todo/test/tao/yaml/getlistby/getlistby.yaml b/module/todo/test/tao/yaml/getlistby/getlistby.yaml new file mode 100644 index 0000000000..af08e92bb3 --- /dev/null +++ b/module/todo/test/tao/yaml/getlistby/getlistby.yaml @@ -0,0 +1,24 @@ +title: zt_getlistby +author: jukui +version: '1.0' +fields: + - field: id + range: 1-5 + - field: name + range: 1-5 + prefix: '待办' + - field: account + range: 'admin' + - field: date + range: 1-9 + prefix: '2023-03-0' + - field: desc + range: 1-5 + prefix: '待办描述' + - field: finishedDate + range: 1-9 + prefix: '2023-05-0' + - field: status + range: 'wait,doing,closed,wait,doing' + - field: assignedTo + range: 'admin'