+ Add program::updateProcess test unit.
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'); // 获取系统中所有项目集的进度
|
||||
Reference in New Issue
Block a user