+ Add programplan-tao getNewParentAndAction test case.
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
#!/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(13);
|
||||
zdTable('task')->config('task')->gen(13);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
title=测试 programplanModel->computeProgress();
|
||||
timeout=0
|
||||
cid=1
|
||||
|
||||
*/
|
||||
|
||||
initData();
|
||||
|
||||
global $tester;
|
||||
$programplan = new programplanTest();
|
||||
$tester->loadModel('programplan')->programplanTao;
|
||||
|
||||
$project = $programplan->getByIdTest(2);
|
||||
$result = $tester->programplan->getNewParentAndAction(['wait' => 1], $project, 0, 'edit');
|
||||
$parent1 = $result['newParent'];
|
||||
|
||||
|
||||
$project = $programplan->getByIdTest(5);
|
||||
$result = $tester->programplan->getNewParentAndAction(['closed' => 1], $project, 0, 'edit');
|
||||
$parent2 = $result['newParent'];
|
||||
|
||||
$project = $programplan->getByIdTest(8);
|
||||
$result = $tester->programplan->getNewParentAndAction(['suspended' => 1], $project, 0, 'edit');
|
||||
$parent3 = $result['newParent'];
|
||||
|
||||
$project = $programplan->getByIdTest(11);
|
||||
$result = $tester->programplan->getNewParentAndAction(['wait' => 2, 'closed' => 1], $project, 0, 'edit');
|
||||
$parent4 = $result['newParent'];
|
||||
|
||||
|
||||
r($parent1) && p('status') && e('wait'); // 返回状态为wait
|
||||
r($parent2) && p('status') && e('closed'); // 返回状态为closed
|
||||
r($parent3) && p('status') && e('suspended'); // 返回状态为suspended
|
||||
r($parent4) && p('status') && e('doing'); // 返回状态为doing
|
||||
@@ -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, 10, 10, 10
|
||||
- field: model
|
||||
range: 'waterfall, , ,waterfall, , ,waterfall, , ,waterfall, , , ,'
|
||||
- field: type
|
||||
range: 'project,stage,stage,project,stage,stage,project,stage,stage,project,stage,status,stage'
|
||||
- field: status
|
||||
range: 'suspended,suspended,wait,suspended,suspended,closed,doing,doing,suspended,wait,wait,wait,wait'
|
||||
- field: parent
|
||||
range: 0, 1, 2, 0, 4, 5, 0, 7, 8, 0, 10, 11, 11
|
||||
- field: path
|
||||
range: '`,1,`, `,1,2,`, `,1,2,3`, `,4,`, `,4,5,`, `,4,5,6,`, `,7,`, `,7,8,`, `,7,8,9,`, `,10,`, `,10,11,`, `,10,11,12,`, `,10,11,13,`'
|
||||
- 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'
|
||||
@@ -0,0 +1,20 @@
|
||||
title: zt_task
|
||||
author: liuchenglong
|
||||
version: "1.0"
|
||||
fields:
|
||||
- field: id
|
||||
range: 1-20
|
||||
- field: execution
|
||||
range: 1-20
|
||||
- field: type
|
||||
range: design,devel,test,study,discuss,ui,affair,misc
|
||||
- field: status
|
||||
range: wait{20}
|
||||
- field: deleted
|
||||
range: 0,1,1,0
|
||||
- field: vision
|
||||
range: rnd,rnd,rnd,lite
|
||||
- field: openedDate
|
||||
range: "20220101 000000:1W" # 生成从2021年1月1日0时0分0秒到当前时间的数据,步长为1周
|
||||
type: timestamp
|
||||
format: "YY/MM/DD hh:mm:ss"
|
||||
Reference in New Issue
Block a user