This commit is contained in:
tianshujie
2023-05-06 14:02:44 +08:00
7 changed files with 236 additions and 2 deletions
+2 -2
View File
@@ -240,7 +240,7 @@ class programplan extends control
* @access public
* @return void
*/
public function edit(string $planID = 0, string $projectID = 0)
public function edit(string $planID = '0', string $projectID = '0')
{
$planID = (int)$planID;
$projectID = (int)$projectID;
@@ -290,7 +290,7 @@ class programplan extends control
/* Set Custom. */
foreach(explode(',', $this->config->programplan->custom->customGanttFields) as $field) $customFields[$field] = $this->lang->programplan->ganttCustom[$field];
$this->programplanZen->buildAjaxCustomView($owner, $module, $customFields);
}
+34
View File
@@ -0,0 +1,34 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 2) . '/todo.class.php';
su('admin');
function initData()
{
zdTable('todo')->config('fetch')->gen(10);
}
/**
title=测试完成待办 todoModel->finish();
timeout=0
cid=1
- 查询id=1的todo并且验证状态
- 属性id @1
- 属性status @wait
- 查询id=9的todo并且验证状态
- 属性id @9
- 属性status @done
*/
initData();
global $tester;
$tester->loadModel('todo')->todoTao;
r($tester->todo->fetch(1)) && p('id,status') && e('1,wait'); // 查询id=1的todo并且验证状态
r($tester->todo->fetch(9)) && p('id,status') && e('9,done'); // 查询id=9的todo并且验证状态
+40
View File
@@ -0,0 +1,40 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
su('admin');
function initData()
{
zdTable('todo')->config('getcountbyaccount')->gen(20);
}
/**
title=测试 todoModel->getCount();
timeout=0
cid=1
- 获取用户admin的所有待办个数 @4
- 获取用户user1的所有待办个数 @3
- 获取用户user2的所有待办个数 @3
- 获取不存在的用户所有待办个数 @0
- 获取用户admin的vision=>rand所有待办个数 @4
*/
initData();
global $tester;
$tester->loadModel('todo')->todoTao;
$accountList = array('admin', 'user1', 'user2', 'user10001');
r($tester->todo->getCountByAccount($accountList[0])) && p() && e('4'); // 获取用户admin的所有待办个数
r($tester->todo->getCountByAccount($accountList[1])) && p() && e('3'); // 获取用户user1的所有待办个数
r($tester->todo->getCountByAccount($accountList[2])) && p() && e('3'); // 获取用户user2的所有待办个数
r($tester->todo->getCountByAccount($accountList[3])) && p() && e('0'); // 获取不存在的用户所有待办个数
r($tester->todo->getCountByAccount($accountList[0],'rnd')) && p() && e('4'); // 获取用户admin的vision=>rand所有待办个数
+45
View File
@@ -0,0 +1,45 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 4) . '/task/test/task.class.php';
su('admin');
function initData()
{
zdTable('todo')->config('getprojectlist')->gen(10);
}
/**
title=测试 todoModel->getCount();
timeout=0
cid=1
- 验证task获得的键值对的个数 @4
*/
initData();
global $tester;
$tester->loadModel('todo');
$taskData1 = array('id' => 10, 'name' => '开发任务一', 'type' => 'devel');
$taskData2 = array('id' => 11, 'name' => '开发任务二', 'type' => 'devel');
$taskData3 = array('id' => 12, 'name' => '开发任务三', 'type' => 'devel');
$taskData4 = array('id' => 13, 'name' => '开发任务四', 'type' => 'devel');
$task = new taskTest();
$task->createObject($taskData1,101);
$task->createObject($taskData2,102);
$task->createObject($taskData3,103);
$task->createObject($taskData4,104);
$ids = range(1,10);
$list = $tester->todo->getByList($ids);
$projectIDList = array_column($list, 'objectID');
$tester->loadModel('todo')->todoTao;
$projectList = $tester->todo->getProjectList('zt_task', $projectIDList);
r(count($projectList)) && p() && e('4'); //验证task获得的键值对的个数
@@ -0,0 +1,35 @@
title: zt_fetch
author: liuchenglong
version: "1.0"
fields:
- field: id
range: 1-100
- field: account
range: 'admin'
- field: date
range: 1-9
prefix: '2023-04-2'
- field: begin
range: 1000-1100
- field: end
range: 1200-1300
- field: type
range: 'custom'
- field: cycle
range: 0
- field: pri
range: 3
- field: name
range: 1-5
prefix: '我的待办'
- field: desc
range: 1-5
prefix: '这是待办描述'
- field: status
range: 'wait,doing,done'
- field: finishedDate
range: 1-9
prefix: '2023-04-2'
- field: closedDate
range: 1-9
prefix: '2023-04-2'
@@ -0,0 +1,38 @@
title: zt_getcountbyaccount
author: liuchenglong
version: "1.0"
fields:
- field: id
range: 1-100
- field: account
range: 'admin,user1,user2'
- field: date
range: 1-9
prefix: '2023-04-2'
- field: begin
range: 1000-1100
- field: end
range: 1200-1300
- field: type
range: 'custom'
- field: cycle
range: 0
- field: pri
range: 3
- field: name
range: 1-5
prefix: '我的待办'
- field: desc
range: 1-5
prefix: '这是待办描述'
- field: status
range: 'wait,doing,done'
- field: vision
range: 'rnd,litle'
- field: finishedDate
range: 1-9
prefix: '2023-04-2'
- field: closedDate
range: 1-9
prefix: '2023-04-2'
@@ -0,0 +1,42 @@
title: zt_getprojectlist
author: liuchenglong
version: "1.0"
fields:
- field: id
range: 1-100
- field: account
range: 'admin,user1,user2'
- field: objectID
range: 10-20
- field: date
range: 1-9
prefix: '2023-04-2'
- field: begin
range: 1000-1100
- field: end
range: 1200-1300
- field: type
range: 'task'
- field: cycle
range: 0
- field: pri
range: 3
- field: name
range: 1-5
prefix: '我的待办'
- field: desc
range: 1-5
prefix: '这是待办描述'
- field: status
range: 'wait,doing,done'
- field: vision
range: 'rnd,litle'
- field: finishedDate
range: 1-9
prefix: '2023-04-2'
- field: closedDate
range: 1-9
prefix: '2023-04-2'