* Modify checkTopstage function test case for programplan model.

This commit is contained in:
jukui
2023-05-09 13:08:15 +08:00
parent af0e8504dc
commit 4b36888f19
4 changed files with 36 additions and 23 deletions
@@ -2,22 +2,11 @@
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 2) . '/programplan.class.php';
zdTable('user')->gen(5);
su('admin');
$execution = zdTable('project');
$execution->id->range('1-5');
$execution->name->range('瀑布项目1,阶段a,阶段a子1,阶段a子1子1,阶段b');
$execution->type->range('project,stage{4}');
$execution->project->range('0,1{4}');
$execution->parent->range('0,1,2,3,1');
$execution->path->range("`,1,`,`,1,2,`,`,1,2,3,`,`,1,2,3,4,`,`,1,5,`");
$execution->status->range('doing,doing,doing,closed,suspended');
$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->realBegan->range('20220212 000000:0')->type('timestamp')->format('YY/MM/DD');
$execution->gen(5);
zdTable('project')->config('checktopstage')->gen(5);
/**
@@ -25,14 +14,10 @@ title=测试programplanModel->checkTopStage();
cid=1
pid=1
测试id为2判断是否为顶级阶段 >> 1
测试id为4判断是否为顶级阶段 >> 0
测试id为5判断是否为顶级阶段 >> 1
*/
$plan = new programplanTest();
r($plan->checkTopStageTest(2)) && p('') && e(1); // 测试id为2判断是否为顶级阶段
r($plan->checkTopStageTest(4)) && p('') && e(0); // 测试id为4判断是否为顶级阶段
r($plan->checkTopStageTest(5)) && p('') && e(1); // 测试id为5判断是否为顶级阶段
r($plan->checkTopStageTest(2)) && p('') && e('1'); // 测试id为2判断是否为顶级阶段
r($plan->checkTopStageTest(4)) && p('') && e('0'); // 测试id为4判断是否为顶级阶段
r($plan->checkTopStageTest(5)) && p('') && e('1'); // 测试id为5判断是否为顶级阶段
@@ -0,0 +1,25 @@
title: checktopstage
author: jukui
version: '1.0'
fields:
- field: id
range: 1-5
- field: project
range: 1-5
- field: name
range: '瀑布项目1,阶段a,阶段a子1,阶段a子1子1,阶段b'
- field: parent
range: '0,1,2,3,1'
- field: type
range: 'project,stage{4}'
- field: grade
range: 1
- field: days
range: 1
- field: status
range: 'doing,doing,doing,closed,suspended'
- field: desc
range: 1-5
prefix: '项目描述'
- field: path
range: "`,1,`,`,1,2,`,`,1,2,3,`,`,1,2,3,4,`,`,1,5,`"