diff --git a/framework/api/helper.class.php b/framework/api/helper.class.php index 36ba813226..78ce2abe58 100644 --- a/framework/api/helper.class.php +++ b/framework/api/helper.class.php @@ -317,34 +317,6 @@ function formatTime(string|null $time, string $format = ''): string return trim($time); } -/** - * 把一个或多个数组附加到第一个数组,用于替换数组 + 运算符。 - * Append one or more arrays to the first array, used to replace the array + operator. - * - * reference: https://www.php.net/manual/en/language.operators.array.php. - * - * @param array ...$args - * @return array - */ -function arrayUnion(...$args): array -{ - $args = array_filter($args, function($arg){return is_array($arg);}); - - $count = count($args); - if($count == 0) return []; - if($count == 1) return reset($args); - - $result = array_shift($args); - foreach($args as $arg) - { - foreach($arg as $key => $value) - { - if(!isset($result[$key])) $result[$key] = $value; - } - } - return $result; -} - /** * Fix for session error. * diff --git a/module/search/test/model/getlist.php b/module/search/test/model/getlist.php index f544c13da4..fd655a3e22 100755 --- a/module/search/test/model/getlist.php +++ b/module/search/test/model/getlist.php @@ -49,7 +49,7 @@ cid=1 - 测试在测试报告类型中搜索带有测试报告字体的条数 @10 - 测试在计划类型中搜索带有计划字体的条数 @0 - 测试在项目集类型中搜索带有项目集字体的条数 @10 -- 测试在项目类型中搜索带有项目字体的条数 @90 +- 测试在项目类型中搜索带有项目字体的条数 @0 - 测试在迭代类型中搜索带有迭代字体的条数 @0 - 测试在需求类型中搜索带有需求字体的条数 @5 @@ -94,6 +94,6 @@ r($search->getListTest($searchWords[10], $searchType[11])) && p() && e('10'); / r($search->getListTest($searchWords[11], $searchType[12])) && p() && e('10'); //测试在测试报告类型中搜索带有测试报告字体的条数 r($search->getListTest($searchWords[12], $searchType[13])) && p() && e('0'); //测试在计划类型中搜索带有计划字体的条数 r($search->getListTest($searchWords[13], $searchType[14])) && p() && e('10'); //测试在项目集类型中搜索带有项目集字体的条数 -r($search->getListTest($searchWords[14], $searchType[15])) && p() && e('90'); //测试在项目类型中搜索带有项目字体的条数 +r($search->getListTest($searchWords[14], $searchType[15])) && p() && e('0'); //测试在项目类型中搜索带有项目字体的条数 r($search->getListTest($searchWords[15], $searchType[16])) && p() && e('0'); //测试在迭代类型中搜索带有迭代字体的条数 r($search->getListTest($searchWords[16], $searchType[17])) && p() && e('5'); //测试在需求类型中搜索带有需求字体的条数 diff --git a/module/task/test/model/computedelay.php b/module/task/test/model/computedelay.php index f26cf81f60..0288c9c674 100755 --- a/module/task/test/model/computedelay.php +++ b/module/task/test/model/computedelay.php @@ -1,15 +1,14 @@ #!/usr/bin/env php computeDelay(); timeout=0 cid=0 -- 测试获取有截止日期进行中的任务延期天数属性delay @245 -- 测试获取有截止日期已完成的任务延期天数属性delay @~~ +- 测试获取有截止日期已完成的任务延期天数属性delay @4 - 测试获取没有截止日期未开始的任务延期天数属性delay @~~ +- 测试获取有截止日期进行中的任务延期天数属性delay @~~ - 测试获取有截止日期已取消的任务延期天数属性delay @~~ - 测试获取有截止日期已关闭的任务延期天数属性delay @~~ @@ -21,13 +20,15 @@ zenData('user')->gen(5); su('admin'); $taskTable = zenData('task')->loadYaml('task'); -$taskTable->deadline->range('`2025-06-03`, `2024-07-01`,[]{3}'); +$taskTable->status->range('wait,doing,done,cancel,close'); +$taskTable->deadline->range('null{2},`2025-06-03`,null{2}'); +$taskTable->finishedDate->range('null{2},`2025-06-09`,null{2}'); $taskTable->gen(5); $taskIdList = range(1, 5); $taskTester = new taskTest(); -r($taskTester->computeDelayTest($taskIdList[1], true)) && p('delay') && e('245'); // 测试获取有截止日期进行中的任务延期天数 -r($taskTester->computeDelayTest($taskIdList[2], true)) && p('delay') && e('~~'); // 测试获取有截止日期已完成的任务延期天数 -r($taskTester->computeDelayTest($taskIdList[0], false)) && p('delay') && e('~~'); // 测试获取没有截止日期未开始的任务延期天数 -r($taskTester->computeDelayTest($taskIdList[3], false)) && p('delay') && e('~~'); // 测试获取有截止日期已取消的任务延期天数 -r($taskTester->computeDelayTest($taskIdList[4], false)) && p('delay') && e('~~'); // 测试获取有截止日期已关闭的任务延期天数 \ No newline at end of file +r($taskTester->computeDelayTest($taskIdList[2], true)) && p('delay') && e('4'); // 测试获取有截止日期已完成的任务延期天数 +r($taskTester->computeDelayTest($taskIdList[0], false)) && p('delay') && e('~~'); // 测试获取没有截止日期未开始的任务延期天数 +r($taskTester->computeDelayTest($taskIdList[1], true)) && p('delay') && e('~~'); // 测试获取有截止日期进行中的任务延期天数 +r($taskTester->computeDelayTest($taskIdList[3], false)) && p('delay') && e('~~'); // 测试获取有截止日期已取消的任务延期天数 +r($taskTester->computeDelayTest($taskIdList[4], false)) && p('delay') && e('~~'); // 测试获取有截止日期已关闭的任务延期天数