Merge branch '15.0.beta3' of https://gitlab.zcorp.cc/easycorp/zentaopms into 15.0.beta3
This commit is contained in:
30
test/model/branch/getbyid.php
Executable file
30
test/model/branch/getbyid.php
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/init.php';
|
||||
/**
|
||||
[case]
|
||||
title=测试 branchModel::getById();
|
||||
cid=1
|
||||
pid=1
|
||||
[group]
|
||||
1. 使用branchID获取一个存在的分支 >> `A`
|
||||
2. 使用branchID和productID获取一个存在的分支 >> `B`
|
||||
3. 使用account获取一个存在的用户 >> ``
|
||||
[esac]
|
||||
*/
|
||||
$branch = $tester->loadModel('branch');
|
||||
|
||||
$app->dbh->query("truncate zt_product");
|
||||
zdImport(TABLE_PRODUCT, "zendata/product.yaml", 10);
|
||||
|
||||
$app->dbh->query("truncate zt_branch");
|
||||
zdImport(TABLE_BRANCH, "zendata/branch.yaml", 10);
|
||||
|
||||
/* Step 1.*/
|
||||
run($branch->getByID(1)) and expect('name');
|
||||
|
||||
/* Step 2.*/
|
||||
run($branch->getByID(2, 2)) and expect('name');
|
||||
|
||||
/* Step 3.*/
|
||||
run($branch->getByID(null)) and expect('name');
|
||||
37
test/zendata/branch.yaml
Normal file
37
test/zendata/branch.yaml
Normal file
@@ -0,0 +1,37 @@
|
||||
title: table zt_branch
|
||||
desc: "分支信息"
|
||||
author: liyuchun
|
||||
version: "1.0"
|
||||
fields:
|
||||
- field: id
|
||||
note: "ID"
|
||||
range: 1-10
|
||||
prefix: ""
|
||||
postfix: "\t"
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: product
|
||||
note: "所属产品"
|
||||
range: 1-2{5}
|
||||
prefix: ""
|
||||
postfix: "\t"
|
||||
format: ""
|
||||
- field: name
|
||||
note: "分支名称"
|
||||
range: A-Z
|
||||
prefix: ""
|
||||
postfix: "\t"
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: order
|
||||
note: "排序"
|
||||
range: 1-10
|
||||
prefix: ""
|
||||
postfix: "\t"
|
||||
format: ""
|
||||
- field: deleted
|
||||
note: "是否删除"
|
||||
range: 0
|
||||
prefix: ""
|
||||
postfix: "\t"
|
||||
format: ""
|
||||
130
test/zendata/product.yaml
Normal file
130
test/zendata/product.yaml
Normal file
@@ -0,0 +1,130 @@
|
||||
title: table zt_product
|
||||
desc: "产品信息"
|
||||
author: liyuchun
|
||||
version: "1.0"
|
||||
fields:
|
||||
- field: id
|
||||
note: "ID"
|
||||
range: 1-11
|
||||
prefix: ""
|
||||
postfix: "\t"
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: program
|
||||
note: "所属项目集"
|
||||
range: 0
|
||||
prefix: ""
|
||||
postfix: "\t"
|
||||
format: ""
|
||||
- field: name
|
||||
note: "产品名称"
|
||||
range: A-Z
|
||||
prefix: ""
|
||||
postfix: "\t"
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: code
|
||||
note: "代号"
|
||||
range: A-Z
|
||||
prefix: ""
|
||||
postfix: "\t"
|
||||
format: ""
|
||||
- field: bind
|
||||
note: "是否绑定"
|
||||
range: 0
|
||||
prefix: ""
|
||||
postfix: "\t"
|
||||
format: ""
|
||||
- field: line
|
||||
note: "产品线"
|
||||
range: 0
|
||||
prefix: ""
|
||||
postfix: "\t"
|
||||
format: ""
|
||||
- field: type
|
||||
note: "类型"
|
||||
range: [branch,normal]{5}
|
||||
prefix: ""
|
||||
postfix: "\t"
|
||||
format: ""
|
||||
- field: status
|
||||
note: "状态"
|
||||
range: "normal"
|
||||
prefix: ""
|
||||
postfix: "\t"
|
||||
format: ""
|
||||
- field: desc
|
||||
note: "描述"
|
||||
range: "批量创建产品"
|
||||
prefix: ""
|
||||
postfix: "\t"
|
||||
format: ""
|
||||
- field: PO
|
||||
note: "产品负责人"
|
||||
range: "admin"
|
||||
prefix: ""
|
||||
postfix: "\t"
|
||||
format: ""
|
||||
- field: QD
|
||||
note: "测试负责人"
|
||||
range: "admin"
|
||||
prefix: ""
|
||||
postfix: "\t"
|
||||
format: ""
|
||||
- field: RD
|
||||
note: "发布负责人"
|
||||
range: "admin"
|
||||
prefix: ""
|
||||
postfix: "\t"
|
||||
format: ""
|
||||
- field: feedback
|
||||
range: ""
|
||||
prefix: ""
|
||||
postfix: "\t"
|
||||
format: ""
|
||||
- field: storyConcept
|
||||
range: 0
|
||||
prefix: ""
|
||||
postfix: "\t"
|
||||
format: ""
|
||||
- field: acl
|
||||
note: "权限"
|
||||
range: [open,private]{5}
|
||||
prefix: ""
|
||||
postfix: "\t"
|
||||
format: ""
|
||||
- field: storyConcept
|
||||
range: 0
|
||||
prefix: ""
|
||||
postfix: "\t"
|
||||
format: ""
|
||||
- field: whitelist
|
||||
range: ""
|
||||
prefix: ","
|
||||
postfix: "\t"
|
||||
format: ""
|
||||
- field: createdBy
|
||||
range: "admin"
|
||||
prefix: ""
|
||||
postfix: "\t"
|
||||
format: ""
|
||||
- field: createdDate
|
||||
range: "(-1M)-(+1w):60"
|
||||
prefix: DateTime
|
||||
type: timestamp
|
||||
format: "YY/MM/DD hh:mm:ss"
|
||||
- field: createdVersion
|
||||
range: "max2.0"
|
||||
prefix: ""
|
||||
postfix: "\t"
|
||||
format: ""
|
||||
- field: order
|
||||
range: 1-10
|
||||
prefix: ""
|
||||
postfix: "\t"
|
||||
format: ""
|
||||
- field: deleted
|
||||
range: 0
|
||||
prefix: ""
|
||||
postfix: "\t"
|
||||
format: ""
|
||||
Reference in New Issue
Block a user