From fd6e64ec62d238568ece39e1491afef8b6514ca6 Mon Sep 17 00:00:00 2001
From: liyang <“liyang@easycorp.ltd”>
Date: Fri, 11 Mar 2022 15:14:53 +0800
Subject: [PATCH] update project data
---
test/class/execution.class.php | 3 ++
test/data/bug.yaml | 2 +-
test/data/execution.yaml | 15 ++++++++--
test/data/executionson.yaml | 13 +++++---
test/data/kanban.yaml | 32 ++++++++++++++++++--
test/data/kanbanspace.yaml | 41 ++++++++++++++++++++++----
test/data/program.yaml | 13 ++++++++
test/data/project.yaml | 13 +++++++-
test/data/user.yaml | 3 +-
test/data/usergroup.yaml | 4 +--
test/data/zentao/config.php | 1 +
test/data/zentao/processor.php | 2 ++
test/model/execution/manageMembers.php | 35 ++++++++++++++++++++++
13 files changed, 155 insertions(+), 22 deletions(-)
create mode 100755 test/model/execution/manageMembers.php
diff --git a/test/class/execution.class.php b/test/class/execution.class.php
index 91c0c9bea5..70f5ab4e8b 100644
--- a/test/class/execution.class.php
+++ b/test/class/execution.class.php
@@ -914,6 +914,8 @@ class executionTest
public function manageMembersTest($executionID, $count, $param = array())
{
+ global $tester;
+ $tester->dbh->query("delete from zt_team where root = $executionID");
$realnames = array();
$roles = array();
$days = array();
@@ -926,6 +928,7 @@ class executionTest
foreach($param as $key => $value) $_POST[$key] = $value;
$object = $this->objectModel->manageMembers($executionID);
unset($_POST);
+ $object = $tester->dbh->query("select * from zt_team where root = $executionID")->fetchAll();
if(dao::isError())
{
$error = dao::getError();
diff --git a/test/data/bug.yaml b/test/data/bug.yaml
index f364bea6fe..b0c1f76e22 100644
--- a/test/data/bug.yaml
+++ b/test/data/bug.yaml
@@ -49,7 +49,7 @@ fields:
- field: found
range: []
- field: steps
- range: ["
【步骤】
【结果】
【期望】
","【步骤】进入成果展示
【结果】乱码
【期望】正常显示
"]
+ range: [【步骤】
【结果】
【期望】
,【步骤】进入成果展示
【结果】乱码
【期望】正常显示
]
- field: status
range: active{50},resolved{30},closed{20}
- field: subStatus
diff --git a/test/data/execution.yaml b/test/data/execution.yaml
index 84e2bcbc65..35587270c9 100644
--- a/test/data/execution.yaml
+++ b/test/data/execution.yaml
@@ -2,6 +2,8 @@ title: table zt_execution
author: Zhu Jinyong
version: "1.0"
fields:
+ - field: id
+ range: 101-700
- field: name
note: "名称"
fields:
@@ -29,9 +31,16 @@ fields:
- field: parent
range: 11-40,41-70,71-100
- field: path
- prefix: ","
- postfix: ","
- range: 101-700
+ fields:
+ - field: path1
+ prefix: ","
+ range: 11-100
+ - field: path2
+ prefix: ","
+ range: 101-700
+ - field: path3
+ range: []
+ postfix: ","
- field: acl
range: open{4},private{4}
- field: whitelist
diff --git a/test/data/executionson.yaml b/test/data/executionson.yaml
index 059468b42c..49ec1af958 100644
--- a/test/data/executionson.yaml
+++ b/test/data/executionson.yaml
@@ -2,6 +2,8 @@ title: table zt_execution
author: Zhu Jinyong
version: "1.0"
fields:
+ - field: id
+ range: 701-730
- field: name
note: "名称"
fields:
@@ -30,13 +32,16 @@ fields:
range: 131-160
- field: path
fields:
- - field: grade1
+ - field: path1
+ prefix: ","
+ range: 41-70
+ - field: path2
prefix: ","
- postfix: ","
range: 131-160
- - field: self
+ - field: path6
+ prefix: ","
+ range: [701-730]
postfix: ","
- range: 701-730
- field: acl
range: open{4},private{4}
- field: PO
diff --git a/test/data/kanban.yaml b/test/data/kanban.yaml
index 278b4744ef..54f26af451 100644
--- a/test/data/kanban.yaml
+++ b/test/data/kanban.yaml
@@ -12,15 +12,41 @@ fields:
- field: name2
range: 1-10000
- field: owner
- range: admin
+ fields:
+ - field: owner1
+ range: po{10},user{10},test{10},pm{10},po{10}
+ - field: owner2
+ range: 15-100{2},3-100{2},1-100{2},1-100{2},1-100{2}
- field: team
- range: ""
+ fields:
+ - field: team1
+ prefix: ","
+ range: user{10},test{10},pm{10},po{10},po{10}
+ - field: team2
+ range: 3-100{2},1-100{2},1-100{2},1-100{2},35-100{2}
+ postfix: ","
+ - field: team3
+ range: po{10},pm{10},test{10},user[10],user{10}
+ - field: team4
+ range: 15-100{2},15-100{2},15-100{2},15-100{2},35-100{2}
+ postfix: ","
- field: desc
range: "看板详情"
- field: acl
range: extend,open
- field: whitelist
- range: ""
+ note: "白名单"
+ fields:
+ - field: whitelist1
+ prefix: ","
+ range: user{10},test{10},pm{10},po{10},po{10}
+ - field: whitelist2
+ range: 3-100{2},1-100{2},1-100{2},1-100{2},35-100{2}
+ postfix: ","
+ - field: whitelist3
+ range: po{10},pm{10},test{10},user[10],user{10}
+ - field: whitelist4
+ range: 15-100{2},15-100{2},15-100{2},15-100{2},35-100{2}
- field: archived
range: "1"
- field: performable
diff --git a/test/data/kanbanspace.yaml b/test/data/kanbanspace.yaml
index 56881803f0..084dff8607 100644
--- a/test/data/kanbanspace.yaml
+++ b/test/data/kanbanspace.yaml
@@ -10,6 +10,13 @@ fields:
prefix: ""
postfix: ""
format: ""
+ - field: name
+ note: "名字"
+ fields:
+ - field: name1
+ range: 协作空间,私有空间,公共空间
+ - field: name2
+ range: 1-100,1-100,1-100
- field: type
note: "类型"
range: cooperation,private,public
@@ -18,17 +25,39 @@ fields:
format: ""
- field: team
note: "团队"
- range: admin
- prefix: ","
- postfix: ""
- format: ""
+ fields:
+ - field: team1
+ prefix: ","
+ range: user{10},test{10},pm{10},po{10},po{10}
+ - field: team2
+ range: 3-100,1-100,1-100,1-100,35-100
+ postfix: ","
+ - field: team3
+ range: po{10},pm{10},test{10},user[10],user{10}
+ - field: team4
+ range: 15-100,15-100,15-100,15-100,35-100
+ postfix: ","
+ - field: whitelist
+ note: "白名单"
+ fields:
+ - field: whitelist1
+ prefix: ","
+ range: user{10},test{10},pm{10},po{10},po{10}
+ - field: whitelist2
+ range: 3-100,1-100,1-100,1-100,35-100
+ postfix: ","
+ - field: whitelist3
+ range: po{10},pm{10},test{10},user[10],user{10}
+ - field: whitelist4
+ range: 15-100,15-100,15-100,15-100,35-100
+ postfix: ","
- field: owner
note: "所属者"
fields:
- field: account1
- range: admin{10},user{10},test{10},pm{10},po{10}
+ range: po{10},user{10},test{10},pm{10},po{10}
- field: account2
- range: [],3-100,1-100,1-100,1-100
+ range: 15-100,3-100,1-100,1-100,1-100
prefix: ""
postfix: ""
- field: acl
diff --git a/test/data/program.yaml b/test/data/program.yaml
index 4f732c6e20..540219d041 100644
--- a/test/data/program.yaml
+++ b/test/data/program.yaml
@@ -2,6 +2,8 @@ title: program
author: Zhu Jinyong
version: "1.0"
fields:
+ - field: id
+ range: 1-10
- field: project
range: 0
- field: model
@@ -19,6 +21,17 @@ fields:
range: wait
- field: parent
range: 0
+ - field: path
+ fields:
+ - field: path1
+ prefix: ","
+ range: 1-10
+ - field: path2
+ range: []
+ postfix: ","
+ - field: path3
+ range: []
+ postfix: ","
- field: grade
range: 1
- field: code
diff --git a/test/data/project.yaml b/test/data/project.yaml
index f96d69954f..acebfb2f65 100644
--- a/test/data/project.yaml
+++ b/test/data/project.yaml
@@ -2,6 +2,8 @@ title: table zt_project
author: Zhu Jinyong
version: "1.0"
fields:
+ - field: id
+ range: 11-100
- field: project
range: 1-10
- field: model
@@ -39,8 +41,17 @@ fields:
range:
- field: parent
range: 1-10
+ - field: path
+ fields:
+ - field: path1
+ prefix: ","
+ range: 1-10
+ - field: path2
+ prefix: ","
+ range: 11-100
+ postfix: ","
- field: grade
- range:
+ range: "2"
- field: code
range: 1-10000
prefix: "project"
diff --git a/test/data/user.yaml b/test/data/user.yaml
index ea3b28fe51..7fbf1a8ca9 100644
--- a/test/data/user.yaml
+++ b/test/data/user.yaml
@@ -19,8 +19,7 @@ fields:
format: ""
- field: dept
note: "所属部门"
- from: dept.yaml
- use: id
+ range: 1-100{10}
- field: account
note: "用户名"
fields:
diff --git a/test/data/usergroup.yaml b/test/data/usergroup.yaml
index 2eb6dd7b2a..2beed6fda3 100644
--- a/test/data/usergroup.yaml
+++ b/test/data/usergroup.yaml
@@ -7,9 +7,9 @@ fields:
note: "用户名"
fields:
- field: account1
- range: test{100},dev{200},pm{10},po{10},td{2},pd{2},qd{2},top{6},test,dev,pm,po,td,pd,qd,other{10}
+ range: test{99},dev{100},pm,po{54},td{100},pd{47},qd{7},top{100},outside{92}
- field: account2
- range: 1-100,1-200,1-10,1-10,1-2,1-2,1-2,1-5,1{8},1-10
+ range: 2-100,1-100,1,48-100,1-100,1-47,94-100,1-100,2-93
- field: group
note: "分组名称"
range: 3{100},2{200},4{10},5{10},6{2},7{2},8{2},9{5},1{8},12{10}
diff --git a/test/data/zentao/config.php b/test/data/zentao/config.php
index cca1eb0893..80299fefe4 100644
--- a/test/data/zentao/config.php
+++ b/test/data/zentao/config.php
@@ -3,6 +3,7 @@ $builder = new stdclass();
$builder->company = array('rows' => 1, 'extends' => array('company'));
$builder->user = array('rows' => 1000, 'extends' => array('user'));
+$builder->usergroup = array('rows' => 600, 'extends' => array('usergroup'));
$builder->dept = array('rows' => 100, 'extends' => array('dept'));
$builder->action = array('rows' => 100, 'extends' => array('action'));
diff --git a/test/data/zentao/processor.php b/test/data/zentao/processor.php
index 9a5237f15a..2a32f031c8 100644
--- a/test/data/zentao/processor.php
+++ b/test/data/zentao/processor.php
@@ -245,6 +245,8 @@ class Processor
private function initUpdateKanban()
{
$this->dao->query("update zt_kanbancolumn set `limit` = '-1' where id >= 1 and id <= 400");
+ $this->dao->query("update zt_kanbanspace set `whitelist` = '' where type in ('cooperation','public')");
+ $this->dao->query("update zt_kanbanspace set `team` = '' where type = 'private'");
$kanban = $this->dao->select('id,type,region,name,color,`limit`,`order`')->from(TABLE_KANBANCOLUMN)->where('id')->gt('400')->fetchAll();
$group = 101;
diff --git a/test/model/execution/manageMembers.php b/test/model/execution/manageMembers.php
new file mode 100755
index 0000000000..397c327fba
--- /dev/null
+++ b/test/model/execution/manageMembers.php
@@ -0,0 +1,35 @@
+#!/usr/bin/env php
+manageMembersTest();
+cid=1
+pid=1
+
+敏捷执行关联用例 >> 101,1,1
+瀑布执行关联用例 >> 131,43,169
+看板执行关联用例 >> 161,68,269
+敏捷执行关联用例统计 >> 4
+瀑布执行关联用例统计 >> 4
+看板执行关联用例统计 >> 4
+
+*/
+
+$executionID = '101';
+$realnames = array('研发主管82', '测试92');
+$roles = array('研发', '研发', '研发');
+$hours = array('3.0', '6.0', '7.0');
+$accounts = array('po82', 'user92', 'dev10');
+$limited = array('yes', 'no', 'yes');
+$days = array('17', '27', '127');
+
+$manageMembers = array('realnames' => $realnames, 'roles' => $roles, 'hours' => $hours, 'accounts' => $accounts, 'limited' => $limited, 'days' => $days);
+$count = array('0','1');
+
+$execution = new executionTest();
+r($execution->manageMembersTest($executionID, $count[0], $manageMembers)) && p('0:root,type,account') && e('101,execution,dev10'); // 团队管理
+r($execution->manageMembersTest($executionID, $count[1], $manageMembers)) && p() && e('3'); // 团队人员管理统计