diff --git a/test/model/branch/getbyid.php b/test/model/branch/getbyid.php new file mode 100755 index 0000000000..7ca458792f --- /dev/null +++ b/test/model/branch/getbyid.php @@ -0,0 +1,30 @@ +#!/usr/bin/env php +> `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'); diff --git a/test/zendata/branch.yaml b/test/zendata/branch.yaml new file mode 100644 index 0000000000..d1b5988585 --- /dev/null +++ b/test/zendata/branch.yaml @@ -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: "" diff --git a/test/zendata/product.yaml b/test/zendata/product.yaml new file mode 100644 index 0000000000..b884d78c25 --- /dev/null +++ b/test/zendata/product.yaml @@ -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: ""