+ Add test case for procesSplan function.

This commit is contained in:
jukui
2023-05-11 18:22:24 +08:00
parent 6cb44ab066
commit c5e79de2cb
4 changed files with 71 additions and 12 deletions
+10 -12
View File
@@ -1,28 +1,26 @@
#!/usr/bin/env php
<?php
declare(strict_types=1);
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/programplan.class.php';
su('admin');
zdTable('project')->config('project')->gen(5);
zdTable('projectproduct')->config('projectproduct')->gen(5);
zdTable('product')->config('product')->gen(2);
/**
title=测试 programplanModel->processPlan();
cid=1
pid=1
测试计算计划131 >> 131,阶段31,已关闭的正常产品21
测试计算计划132 >> 132,阶段32,已关闭的正常产品22
测试计算计划133 >> 133,阶段33,已关闭的正常产品23
测试计算计划134 >> 134,阶段34,已关闭的正常产品24
测试计算计划135 >> 135,阶段35,已关闭的正常产品25
*/
$planIDList = array(131, 132, 133, 134, 135);
$planIDList = array(1, 2, 3);
$programplan = new programplanTest();
r($programplan->processPlanTest($planIDList[0])) && p('id,name,productName') && e('131,阶段31,已关闭的正常产品21'); // 测试计算计划131
r($programplan->processPlanTest($planIDList[1])) && p('id,name,productName') && e('132,阶段32,已关闭的正常产品22'); // 测试计算计划132
r($programplan->processPlanTest($planIDList[2])) && p('id,name,productName') && e('133,阶段33,已关闭的正常产品23'); // 测试计算计划133
r($programplan->processPlanTest($planIDList[3])) && p('id,name,productName') && e('134,阶段34,已关闭的正常产品24'); // 测试计算计划134
r($programplan->processPlanTest($planIDList[4])) && p('id,name,productName') && e('135,阶段35,已关闭的正常产品25'); // 测试计算计划135
r($programplan->processPlanTest($planIDList[0])) && p('id,name,productName') && e('1,瀑布项目1,瀑布产品1'); // 测试id为1的瀑布项目
r($programplan->processPlanTest($planIDList[1])) && p('id,name,productName,attribute') && e('2,阶段a,瀑布产品2,review'); // 测试id为2的瀑布项目阶段
r($programplan->processPlanTest($planIDList[2])) && p('id,name,productName,attribute') && e('3,阶段a子1,瀑布产品2,release'); // 测试id为3的瀑布项目阶段
@@ -0,0 +1,19 @@
title: zt_product
author: jukui
version: '1.0'
fields:
- field: id
range: 1-10
- field: name
range: 1-10
prefix: '瀑布产品'
- field: code
range: 1-10
prefix: 'code'
- field: desc
range: 1-10
prefix: '描述'
- field: createdDate
range: '`2023-05-11 16:32:06`'
- field: program
range: 1-10
@@ -0,0 +1,30 @@
title: zt_project
author: jukui
version: '1.0'
fields:
- field: id
range: 1-10
- field: project
range: '0,1,2,3,1,2,2,1,5,5'
- field: name
range: '瀑布项目1,阶段a,阶段a子1,阶段a子1子1,阶段b,阶段a子2,阶段a子3,阶段a子1子2,阶段b子1,阶段b子2'
- field: parent
range: '0,1,2,1,1,1,2,3,5,10'
- field: type
range: 'project,stage{9}'
- field: percent
range: 1-10
prefix: '2'
- field: grade
range: 1
- field: days
range: 1
- field: status
range: 'doing,doing,doing,closed,suspended,closed'
- field: desc
range: 1-10
prefix: '项目描述'
- field: path
range: "`,1,`,`,1,2,`,`,1,2,3,`,`,1,2,3,4,`,`,1,5,`,`,1,2,6,`,`,1,2,7`,`1,2,3,8`,`1,5.9`,`1,5,10`"
- field: attribute
range: '``,review,release,qa,dev,design,design,design,design,design'
@@ -0,0 +1,12 @@
title: zt_projectproduct
author: jukui
version: '1.0'
fields:
- field: project
range: 1-10
- field: product
range: '1,2{9}'
- field: branch
range: 0
- field: plan
range: 0