* Add case of the buildExecutionCards method.

This commit is contained in:
tianshujie
2023-08-29 16:47:05 +08:00
parent 503d66a4dd
commit 57ee9c9c43
10 changed files with 249 additions and 0 deletions
+26
View File
@@ -1794,4 +1794,30 @@ class kanbanTest
$object->object = !empty($object->object) ? $object->object : 0;
return $object;
}
/**
* 构建迭代看板的卡片数据。
* Build the card data for the execution Kanban.
*
* @param int $executionID
* @param int $laneID
* @param string $columnType
* @param array $cardIdList
* @access public
* @return array
*/
public function buildExecutionCardsTest(int $executionID, int $laneID, string $columnType, array $cardIdList): array
{
$lane = $this->objectModel->getLaneById($laneID);
$objectGroup['story'] = $this->objectModel->loadModel('story')->getExecutionStories($executionID, 0, 't1.`order`_desc', 'allStory');
$objectGroup['bug'] = $this->objectModel->loadModel('bug')->getExecutionBugs($executionID);
$objectGroup['task'] = $this->objectModel->loadModel('execution')->getKanbanTasks($executionID, "id");
$storyCardMenu = $this->objectModel->getKanbanCardMenu($executionID, $objectGroup['story'], 'story');
$bugCardMenu = $this->objectModel->getKanbanCardMenu($executionID, $objectGroup['bug'], 'bug');
$taskCardMenu = $this->objectModel->getKanbanCardMenu($executionID, $objectGroup['task'], 'task');
return $this->objectModel->buildExecutionCards($lane, array(), $columnType, $cardIdList, $objectGroup, '', $storyCardMenu, $bugCardMenu, $taskCardMenu);
}
}
@@ -0,0 +1,36 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/kanban.class.php';
su('admin');
zdTable('project')->config('project')->gen(5);
zdTable('story')->gen(10);
zdTable('bug')->gen(10);
zdTable('task')->config('task')->gen(10);
zdTable('kanbanlane')->config('kanbanlane')->gen(10);
zdTable('kanbancell')->config('kanbancell')->gen(30);
/**
title=测试 kanbanModel->buildExecutionCards();
timeout=0
cid=1
*/
$executionIdList = array(1, 2, 3);
$laneIdList = array(1, 2, 3, 4, 5, 6, 7, 8 ,9);
$columnTypeList = array('task', 'story', 'bug');
$cardIdList = array(1, 2, 3, 4, 5);
$kanbanTester = new kanbanTest();
r($kanbanTester->buildExecutionCardsTest($executionIdList[0], $laneIdList[0], $columnTypeList[0], $cardIdList)) && p('cards:task:0') && e('~~'); // 构造迭代的任务卡片
r($kanbanTester->buildExecutionCardsTest($executionIdList[1], $laneIdList[1], $columnTypeList[0], $cardIdList)) && p('cards:task:0') && e('N/A'); // 构造阶段的任务卡片
r($kanbanTester->buildExecutionCardsTest($executionIdList[2], $laneIdList[2], $columnTypeList[0], $cardIdList)) && p('cards:task:0') && e('N/A'); // 构造看板的任务卡片
r($kanbanTester->buildExecutionCardsTest($executionIdList[0], $laneIdList[3], $columnTypeList[1], $cardIdList)) && p('cards:story:0') && e('N/A'); // 构造迭代的需求卡片
r($kanbanTester->buildExecutionCardsTest($executionIdList[1], $laneIdList[4], $columnTypeList[1], $cardIdList)) && p('cards:story:0') && e('N/A'); // 构造阶段的需求卡片
r($kanbanTester->buildExecutionCardsTest($executionIdList[2], $laneIdList[5], $columnTypeList[1], $cardIdList)) && p('cards:story:0') && e('N/A'); // 构造看板的需求卡片
r($kanbanTester->buildExecutionCardsTest($executionIdList[0], $laneIdList[6], $columnTypeList[2], $cardIdList)) && p('cards:bug:0') && e('N/A'); // 构造迭代的Bug卡片
r($kanbanTester->buildExecutionCardsTest($executionIdList[1], $laneIdList[7], $columnTypeList[2], $cardIdList)) && p('cards:bug:0') && e('N/A'); // 构造阶段的Bug卡片
r($kanbanTester->buildExecutionCardsTest($executionIdList[2], $laneIdList[8], $columnTypeList[2], $cardIdList)) && p('cards:bug:0') && e('N/A'); // 构造看板的Bug卡片
+14
View File
@@ -0,0 +1,14 @@
title: table zt_kanban
desc: "看板"
author: Tian Shujie
version: "1.0"
fields:
- field: id
range: 1-100
- field: space
range: 4-100
- field: name
prefix: 看板
range: 1-100
- field: acl
range: open,private,extend
+13
View File
@@ -0,0 +1,13 @@
title: table zt_kanbancard
desc: 看板卡片
author: Tian Shujie
version: "1.0"
fields:
- field: id
range: 1-100
- field: kanban
range: 1-30{8}
- field: region
range: 4-100{8}
- field: group
range: 4-100{8}
+22
View File
@@ -0,0 +1,22 @@
title: table zt_kanbancell
desc: "看板单元格"
author: Tian Shujie
version: "1.0"
fields:
- field: kanban
range: 2{6},3{6},4{6},1-10{4}
- field: lane
range: 1{5},2{3},3{2},4{7},5{3},7{3},8{2},9{5},10-100{4}
- field: column
range: 1,3-6,10-12,17-18,22,23,25,26,28-32,34,50,52-53,63-64,74-75,78-80,82-100
- field: type
range: task{10},bug{10},story{10},common{30}
- field: cards
fields:
- field: card1
prefix: ","
postfix: ","
range: 1-20:2{3!},1-40:2
- field: card2
postfix: ","
range: 2-20:2{3!},2-40:2
+9
View File
@@ -0,0 +1,9 @@
title: table zt_kanbangroup
desc: "看板单元格"
author: Tian Shujie
version: "1.0"
fields:
- field: kanban
range: 2-4,1-100
- field: region
range: 1-100
+27
View File
@@ -0,0 +1,27 @@
title: table zt_kanbanlane
desc: "看板泳道"
author: Tian Shujie
version: "1.0"
fields:
- field: id
range: 1-20
- field: execution
range: "2-4{3!},0{11}"
- field: name
prefix: 泳道
range: 1-10
- field: region
range: 1-3{3!},4-20
- field: type
range: "task{3},story{3},bug{3},common{11}"
- field: group
range: 1-10
- field: color
range: "#333"
- field: lastEditedTime
range: "20220101 000000:1D"
type: timestamp
format: "YY/MM/DD hh::mm:ss"
postfix: "\t"
- field: deleted
range: "0"
+26
View File
@@ -0,0 +1,26 @@
title: table zt_kanbanregion
desc: 看板区域
author: Tian Shujie
version: "1.0"
fields:
- field: id
range: 1-100
- field: kanban
range: 2,3,4,1-96
- field: space
range: "0{3},1-10{10}"
- field: name
range: 1-100
prefix: 区域
- field: createdBy
range: "admin,user1,user2,user3,user4,user5"
- field: createdDate
range: "20201101 000000:1D"
type: timestamp
format: "YY/MM/DD hh::mm:ss"
postfix: "\t"
- field: lastEditedDate
range: "20220101 000000:1D"
type: timestamp
format: "YY/MM/DD"
postfix: "\t"
+24
View File
@@ -0,0 +1,24 @@
title: table zt_project
author: Hu Fangzhou
version: "1.0"
fields:
- field: id
range: 1-100
- field: name
range: 项目,迭代,阶段,看板{2}
- field: project
range: 0{1},1{4}
- field: type
range: project,sprint,stage,kanban{2}
- field: vision
range: rnd{4},lite
- field: begin
range: "20201101 000000:1D"
type: timestamp
format: "YY/MM/DD hh::mm:ss"
postfix: "\t"
- field: end
range: "20220101 000000:1D"
type: timestamp
format: "YY/MM/DD"
postfix: "\t"
+52
View File
@@ -0,0 +1,52 @@
title: zt_task
author: Mengyi Liu
version: "1.0"
fields:
- field: id
range: 1-100
- field: project
range: 1
- field: execution
range: 3
- field: module
range: 0{3},1{3},2{3},3{3}
- field: story
range: 1,0{9}
- field: consumed
range: 0,2{4},0{3},3
- field: parent
range: "0{5},`-1`,6,0{2}"
- field: status
range: "wait,doing,done,cancel,closed,wait{3},doing"
- field: mode
range: "[]{7},linear,multi"
- field: deleted
range: 0{9},1{3}
- field: assignedTo
range: "[],admin{2},[]{3}"
- field: mailto
fields:
- field: mailto1
range: "[]{3},admin,[]{2}"
postfix: ","
- field: mailto2
range: "[]{2},user1{3}"
- field: estStarted
range: "20201101 000000:1D"
type: timestamp
format: "YY/MM/DD hh::mm:ss"
postfix: "\t"
- field: deadline
range: "20210101 000000:1D"
type: timestamp
format: "YY/MM/DD"
postfix: "\t"
- field: finishedBy
range: "[]{4},admin,[]{4}"
- field: finishedDate
range: "20210101 000000:1D"
type: timestamp
format: "YY/MM/DD hh::mm:ss"
postfix: "\t"
- field: closedReason
range: "[]{4},done,[]{4}"