+ Add program::updateProcess test unit.

This commit is contained in:
tianshujie
2023-11-27 16:30:28 +08:00
parent 6d8442d6b0
commit 5ef17e97eb
2 changed files with 34 additions and 0 deletions
+15
View File
@@ -564,4 +564,19 @@ class programTest
return $this->program->dao->select('*')->from(TABLE_PROJECT)->where('type')->eq('project')->beginIF(!empty($projectIdList))->andWhere('id')->in($projectIdList)->fi()->fetchAll('id');
}
/**
* 更新项目集的进度。
* Update program progress.
*
* @access public
* @return array
*/
public function updateProcessTest(): array
{
$this->program->updateProcess();
if(dao::isError()) return dao::getError();
return $this->program->dao->select('*')->from(TABLE_PROJECT)->where('type')->eq('program')->fetchAll('id');
}
}
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
/**
title=测试 programTao::updateProcess();
timeout=0
cid=1
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/program.class.php';
zdTable('project')->config('program')->gen(20);
zdTable('user')->gen(5);
su('admin');
$programTester = new programTest();
r($programTester->updateProcessTest()) && p('1:progress') && e('0.00'); // 获取系统中所有项目集的进度