* [misc] Fix unit tests for programModel::suspend() method

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
liugang
2025-10-11 09:38:18 +08:00
co-authored by Claude
parent 7d92ddf8ec
commit d8201d4591
2 changed files with 62 additions and 19 deletions
@@ -1,4 +1,5 @@
<?php
declare(strict_types = 1);
class programTest
{
/**
@@ -612,10 +613,17 @@ class programTest
*/
public function suspendTest(int $programID, array $postData): bool
{
// 检查项目集是否存在
$program = $this->program->getByID($programID);
if(!$program) return false;
$postDataObj = new stdclass();
$postDataObj->status = 'suspended';
$postDataObj->comment = isset($postData['comment']) ? $postData['comment'] : '';
$postDataObj->uid = isset($postData['uid']) ? $postData['uid'] : '';
$postDataObj->lastEditedBy = 'admin';
$postDataObj->lastEditedDate = helper::now();
foreach($postData as $field => $value) $postDataObj->{$field} = $value;
$result = $this->program->suspend($programID, $postDataObj);