+ Add programplan-model setTreePath test case.
This commit is contained in:
@@ -1,28 +1,31 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/programplan.class.php';
|
||||
su('admin');
|
||||
|
||||
|
||||
function initData()
|
||||
{
|
||||
zdTable('project')->config('project')->gen(10);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
title=测试 programplanModel->setTreePath();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试更新计划131的路径 >> 阶段31;,41,131,
|
||||
测试更新计划132的路径 >> 阶段32;,42,132,
|
||||
测试更新计划133的路径 >> 阶段33;,43,133,
|
||||
测试更新计划134的路径 >> 阶段34;,44,134,
|
||||
测试更新计划135的路径 >> 阶段35;,45,135,
|
||||
|
||||
*/
|
||||
$planIDList = array(131, 132, 133, 134, 135);
|
||||
|
||||
$programplan = new programplanTest();
|
||||
initData();
|
||||
|
||||
global $tester;
|
||||
$tester->loadModel('programplan');
|
||||
|
||||
$tester->programplan->setTreePath(2);
|
||||
$tester->programplan->setTreePath(9);
|
||||
|
||||
|
||||
r($tester->programplan->getByID(2)) && p('path|grade', '|') && e(',1,2,| 1'); // 给stageID=2没有子阶段不走if设置path,grade
|
||||
r($tester->programplan->getByID(9)) && p('path|grade', '|') && e(',7,8,9,| 3'); // 给stageID=9有子阶段走if设置path,grade
|
||||
|
||||
r($programplan->setTreePathTest($planIDList[0])) && p('name;path') && e('阶段31;,41,131,'); // 测试更新计划131的路径
|
||||
r($programplan->setTreePathTest($planIDList[1])) && p('name;path') && e('阶段32;,42,132,'); // 测试更新计划132的路径
|
||||
r($programplan->setTreePathTest($planIDList[2])) && p('name;path') && e('阶段33;,43,133,'); // 测试更新计划133的路径
|
||||
r($programplan->setTreePathTest($planIDList[3])) && p('name;path') && e('阶段34;,44,134,'); // 测试更新计划134的路径
|
||||
r($programplan->setTreePathTest($planIDList[4])) && p('name;path') && e('阶段35;,45,135,'); // 测试更新计划135的路径
|
||||
@@ -0,0 +1,24 @@
|
||||
title: zt_project
|
||||
author: liuchenglong
|
||||
version: "1.0"
|
||||
fields:
|
||||
- field: id
|
||||
range: 1-20
|
||||
- field: project
|
||||
range: 0, 1, 1, 0, 4, 4, 0, 7, 7, 0
|
||||
- field: model
|
||||
range: 'waterfall, , ,waterfall, , ,waterfall, , , ,'
|
||||
- field: type
|
||||
range: 'project,stage,stage,project,stage,stage,project,stage,stage,project,stage,status,stage,stage'
|
||||
- field: status
|
||||
range: 'suspended,suspended,wait,suspended,suspended,closed,doing,doing,suspended,wait'
|
||||
- field: parent
|
||||
range: 0, 1, 2, 0, 4, 5, 0, 7, 8, 9
|
||||
- field: path
|
||||
range: '`,1,`, ``, `,1,2,3`, `,4,`, `,4,5,`, `,4,5,6,`, `,7,`, `,7,8,`, ``, `,7,8,9,10,`'
|
||||
- field: hasProduct
|
||||
range: 1, 1, 1, 1, 1, 0
|
||||
- field: name
|
||||
range: '项目1, 执行1-1, 执行1-1-1, 项目2, 执行2-1, 执行2-1-1, 项目3, 执行3-1, 执行3-1-1'
|
||||
- field: code
|
||||
range: 'sprint1, sprint1-1, sprint1-1-1, sprint2, sprint2-1, sprint2-1-1, sprint3, sprint3-1, sprint3-1-1'
|
||||
Reference in New Issue
Block a user