+ Add case for the processExportTasks method.
This commit is contained in:
+23
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/task.class.php';
|
||||
|
||||
zdTable('user')->gen(10);
|
||||
zdTable('task')->config('task', true)->gen(30);
|
||||
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=taskModel->processExportTasks();
|
||||
timeout=0
|
||||
cid=1
|
||||
|
||||
*/
|
||||
|
||||
$taskTester = new taskTest();
|
||||
|
||||
$taskIdList = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
|
||||
r($taskTester->processExportTasksTest(array())) && p() && e('0'); // 测试空数据
|
||||
r($taskTester->processExportTasksTest($taskIdList)) && p('9:name') && e('开发任务20'); // 测试处理任务数据
|
||||
@@ -2013,4 +2013,18 @@ class taskTest
|
||||
|
||||
return $lang->task->report->$chartType;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理导出的任务信息。
|
||||
* Process export task information.
|
||||
*
|
||||
* @param array $taskIdList
|
||||
* @access public
|
||||
* @return object[]
|
||||
*/
|
||||
public function processExportTasksTest(array $taskIdList): array
|
||||
{
|
||||
$tasks = $this->objectModel->dao->select('*')->from(TABLE_TASK)->where('id')->in($taskIdList)->fetchAll();
|
||||
return $this->objectModel->processExportTasks($tasks);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user