* Add test case.

This commit is contained in:
caoyanyi
2023-01-11 15:46:05 +08:00
parent cba5433ddc
commit d30e78f620
2 changed files with 51 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
$execution = zdTable('project');
$execution->id->range('1-5');
$execution->name->range('项目集1,项目1,迭代1,阶段1,看板1');
$execution->type->range('program,project,sprint,stage,kanban');
$execution->parent->range('0,1,2{3}');
$execution->status->range('wait{3},suspended,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);
su('admin');
/**
title=测试 executionModel::saveState();
cid=1
pid=1
查看传入空返回的下拉菜单 >> 执行
查看传入id=1, 请求all方法的执行返回的下拉菜单 >> 0
查看传入id=1,请求tasks方法的执行返回的下拉菜单 >> 项目集1
*/
$methods = array('all', 'task');
$executionTester = new executionTest();
$switcher1 = $executionTester->getSwitcherTest(0);
$switcher2 = $executionTester->getSwitcherTest(1, $methods[0]);
$switcher3 = $executionTester->getSwitcherTest(1, $methods[1]);
r(strip_tags($switcher1)) && p() && e('执行'); // 查看传入空返回的下拉菜单
r(strip_tags($switcher2)) && p() && e('0'); // 查看传入id=1, 请求all方法的执行返回的下拉菜单
r(strip_tags($switcher3)) && p() && e('项目集1'); // 查看传入id=1,请求tasks方法的执行返回的下拉菜单