+ Add case for the processExportTasks method.

This commit is contained in:
tianshujie
2023-08-21 15:21:53 +08:00
parent 19a31d5bc4
commit d536002dc3
2 changed files with 37 additions and 0 deletions
+23
View File
@@ -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'); // 测试处理任务数据
+14
View File
@@ -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);
}
}