+ Add case for activate method.

This commit is contained in:
tianshujie
2023-09-14 13:48:19 +08:00
parent 8b7d604481
commit 2129006198
2 changed files with 54 additions and 0 deletions
+27
View File
@@ -497,4 +497,31 @@ class programTest
if(dao::isError()) return dao::getError();
return $changes;
}
/**
* 激活一个项目集。
* Activate a program.
*
* @param int $programID
* @param array $postData
* @access public
* @return array
*/
public function activateTest(int $programID, array $postData): array
{
$now = helper::now();
$oldProgram = $this->program->getByID($programID);
$program = new stdclass();
$program->status = 'doing';
$program->lastEditedDate = $now;
$program->lastEditedBy = 'admin';
$program->realEnd = null;
foreach($postData as $field => $value) $program->{$field} = $value;
$changes = $this->program->activate($program, $oldProgram);
if(dao::isError()) return dao::getError();
return $changes;
}
}