* Unit test of testsuite getunitsuites method.

This commit is contained in:
wangxuepeng
2023-09-11 07:43:30 +00:00
parent 8f38dcee6e
commit 183a677956
2 changed files with 87 additions and 15 deletions
+11 -15
View File
@@ -4,20 +4,19 @@ include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/testsuite.class.php';
su('admin');
zdTable('testsuite')->config('testsuite')->gen(9);
/**
title=测试 testsuiteModel->getUnitSuites();
cid=1
pid=1
测试productID值为1,orderBy为id_desc >> 0
测试productID值为1,orderBy为id_asc >> 0
测试productID值为1,orderBy为id_desc >> 0
测试productID值为1,orderBy为id_desc >> 0
测试productID值为1,orderBy为id_asc >> 0
测试productID值为1,orderBy为name_desc,id_desc >> 0
测试productID值为1,orderBy为name_asc,id_desc >> 0
测试productID值为1,orderBy为id_desc >> 0
测试productID值为1,orderBy为id_asc >> 0
测试productID值为1,orderBy为name_desc,id_desc >> 0
测试productID值为1,orderBy为name_asc,id_desc >> 0
测试productID值为1,orderBy为name_asc,id_desc >> 0
*/
$productID = array(1, 0);
@@ -25,11 +24,8 @@ $orderBy = array('id_desc', 'id_asc', 'name_desc,id_desc', 'name_asc,id_desc')
$testsuite = new testsuiteTest();
r($testsuite->getUnitSuitesTest($productID[0], $orderBy[0])) && p() && e('0'); //测试productID值为1,orderBy为id_desc
r($testsuite->getUnitSuitesTest($productID[0], $orderBy[1])) && p() && e('0'); //测试productID值为1,orderBy为id_asc
r($testsuite->getUnitSuitesTest($productID[0], $orderBy[2])) && p() && e('0'); //测试productID值为1,orderBy为name_desc,id_desc
r($testsuite->getUnitSuitesTest($productID[0], $orderBy[3])) && p() && e('0'); //测试productID值为1,orderBy为name_asc,id_desc
r($testsuite->getUnitSuitesTest($productID[1], $orderBy[0])) && p() && e('0'); //测试productID值为1,orderBy为id_desc
r($testsuite->getUnitSuitesTest($productID[1], $orderBy[1])) && p() && e('0'); //测试productID值为1,orderBy为id_asc
r($testsuite->getUnitSuitesTest($productID[1], $orderBy[2])) && p() && e('0'); //测试productID值为1,orderBy为name_desc,id_desc
r($testsuite->getUnitSuitesTest($productID[1], $orderBy[3])) && p() && e('0'); //测试productID值为1,orderBy为name_asc,id_desc
r($testsuite->getUnitSuitesTest($productID[0], $orderBy[0])) && p() && e('0'); //测试productID值为1,orderBy为id_desc
r($testsuite->getUnitSuitesTest($productID[1], $orderBy[0])) && p('9:name;3:name') && e('这是测试套件名称9;这是测试套件名称3'); //测试productID值为1,orderBy为id_desc
r($testsuite->getUnitSuitesTest($productID[1], $orderBy[1])) && p('3:name;9:name') && e('这是测试套件名称3;这是测试套件名称9'); //测试productID值为1,orderBy为id_asc
r($testsuite->getUnitSuitesTest($productID[1], $orderBy[2])) && p('9:name;3:name') && e('这是测试套件名称9;这是测试套件名称3'); //测试productID值为1,orderBy为name_desc,id_desc
r($testsuite->getUnitSuitesTest($productID[1], $orderBy[3])) && p('3:name;9:name') && e('这是测试套件名称3;这是测试套件名称9'); //测试productID值为1,orderBy为name_asc,id_desc
@@ -0,0 +1,76 @@
title: table zt_testsuite
desc: "测试套件"
author: automated export
version: "1.0"
fields:
- field: id
note: "ID"
range: 1-10000
prefix: ""
postfix: ""
loop: 0
format: ""
- field: product
note: "所属产品"
range: "1,0{100!},0"
prefix: ""
postfix: ""
loop: 0
format: ""
- field: name
note: "名称"
range: 1-10000
prefix: "这是测试套件名称"
postfix: ""
loop: 0
format: ""
- field: desc
note: "描述"
range: 1-10000
prefix: "这是测试套件的描述"
postfix: ""
loop: 0
format: ""
- field: type
note: "类型"
range: "[public,private,unit]{100!},library"
prefix: ""
postfix: ""
loop: 0
format: ""
- field: addedBy
note: "由谁创建"
fields:
- field: addedBy1
range: dev{100},user{100},admin
- field: addedBy2
range: 1-100,1-100,[]
prefix: ""
postfix: ""
loop: 0
format: ""
- field: addedDate
note: "创建日期"
range: "(M)-(w)"
type: timestamp
format: "YYYY-MM-DD hh:mm:ss"
- field: lastEditedBy
note: "最后编辑者"
from: common.user.v1.yaml
use: user
prefix: ""
postfix: ""
loop: 0
format: ""
- field: lastEditedDate
note: "创建日期"
range: "(M)-(w)"
type: timestamp
format: "YYYY-MM-DD hh:mm:ss"
- field: deleted
note: "是否删除"
range: 0
prefix: ""
postfix: ""
loop: 0
format: ""