* [unittest] fix unittest error.

This commit is contained in:
tianshujie
2025-09-22 15:21:41 +08:00
parent ae7b4ccbfb
commit 798eb7a56c
2 changed files with 17 additions and 2 deletions
@@ -781,4 +781,19 @@ class projectTest
return $e->getMessage();
}
}
/**
* Test setMenuByModel.
*
* @param string $model
* @access public
* @return string
*/
public function setMenuByModelTest($model)
{
$this->objectModel->setMenuByModel($model);
global $lang;
return $lang->executionCommon;
}
}
+2 -2
View File
@@ -22,7 +22,7 @@ cid=1
*/
$projectTester = new Project();
$projectTester = new projectTest();
r($projectTester->setMenuByModelTest('')) && p() && e('迭代'); // 项目不存在的情况
r($projectTester->setMenuByModelTest('error')) && p() && e('迭代'); // 项目不存在的情况
@@ -30,4 +30,4 @@ r($projectTester->setMenuByModelTest('scrum')) && p() && e('迭代');
r($projectTester->setMenuByModelTest('agileplus')) && p() && e('迭代'); // 融合敏捷项目
r($projectTester->setMenuByModelTest('waterfall')) && p() && e('阶段'); // 融合瀑布项目
r($projectTester->setMenuByModelTest('waterfallplus')) && p() && e('阶段'); // 瀑布项目
r($projectTester->setMenuByModelTest('kanban')) && p() && e('项目看板'); // 看板项目
r($projectTester->setMenuByModelTest('kanban')) && p() && e('项目看板'); // 看板项目