* Add case of execution model.

This commit is contained in:
tianshujie
2023-01-29 11:12:13 +08:00
parent 506981148e
commit c81992a1c2
2 changed files with 68 additions and 0 deletions
+18
View File
@@ -15,6 +15,24 @@ class executionTest
$this->productModel = $tester->loadModel('product');
}
/**
* Compute cfd of a execution.
*
* @param int|string|array $executionID
* @access public
* @return array
*/
public function computeCFDTest($executionID = 0)
{
$this->executionModel->computeCFD($executionID);
$today = helper::today();
return $this->executionModel->dao->select('*')->from(TABLE_CFD)
->where('date')->eq($today)
->beginIF(!empty($executionID))->andWhere('execution')->in($executionID)->fi()
->fetchAll('id');
}
/**
* Get no multiple execution id.
*
+50
View File
@@ -0,0 +1,50 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
zdTable('user')->gen(5);
su('admin');
$execution = zdTable('project');
$execution->id->range('1-5');
$execution->name->range('项目集1,项目1,看板1,看板2,看板3');
$execution->type->range('program,project,,kanban{3}');
$execution->parent->range('0,1,2{3}');
$execution->status->range('wait{3},closed,doing');
$execution->openedBy->range('admin,user1');
$execution->begin->range('20220112 000000:0')->type('timestamp')->format('YY/MM/DD');
$execution->end->range('20220212 000000:0')->type('timestamp')->format('YY/MM/DD');
$execution->gen(5);
$kanbanCell = zdTable('kanbancell');
$kanbanCell->id->range('1-9');
$kanbanCell->kanban->range('3{3},4{3},5{3}');
$kanbanCell->lane->range('1-9');
$kanbanCell->column->range('1-9');
$kanbanCell->type->range('task,bug,story');
$kanbanCell->cards->range('`,1,2,3,`{3},`,4,5,`{3},6{3}');
$kanbanCell->gen(9);
$kanbanColumn = zdTable('kanbancolumn');
$kanbanColumn->id->range('1-9');
$kanbanColumn->name->range('1-9')->prefix('看板列');
$kanbanColumn->type->range('1-9')->prefix('column');
$kanbanColumn->gen(9);
/**
title=测试executionModel->computeCFD();
cid=1
pid=1
获取所有看板执行的累计卡片个数 >> 12
获取看板1的累计流图信息 >> 3,task
*/
$executionTester = new executionTest();
$allExecutionCFDList = $executionTester->computeCFDTest();
$singleExecutionCFDList = $executionTester->computeCFDTest(3);
r(count($allExecutionCFDList)) && p() && e('12'); // 获取所有看板执行的累计卡片个数
r(current($singleExecutionCFDList)) && p('execution,type') && e('3,task'); // 获取看板1的累计流图信息