+ [misc] Add unit tests for tutorialModel::getBug() method

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
liugang
2025-09-15 15:06:26 +08:00
co-authored by Claude
parent af7a37ba26
commit c67332b621
2 changed files with 44 additions and 0 deletions
@@ -631,4 +631,19 @@ class tutorialTest
return $result;
}
/**
* 测试获取新手模式Bug。
* Test get bug.
*
* @access public
* @return object
*/
public function getBugTest(): object
{
$result = $this->objectModel->getBug();
if(dao::isError()) return dao::getError();
return $result;
}
}
+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/env php
<?php
/**
title=测试 tutorialModel::getBug();
timeout=0
cid=0
- 步骤1:验证Bug对象ID属性id @1
- 步骤2:验证Bug对象标题属性title @Test bug-active
- 步骤3:验证Bug对象状态属性status @active
- 步骤4:验证Bug对象类型属性type @codeerror
- 步骤5:验证Bug对象项目ID属性project @2
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/tutorial.unittest.class.php';
su('admin');
$tutorialTest = new tutorialTest();
r($tutorialTest->getBugTest()) && p('id') && e('1'); // 步骤1:验证Bug对象ID
r($tutorialTest->getBugTest()) && p('title') && e('Test bug-active'); // 步骤2:验证Bug对象标题
r($tutorialTest->getBugTest()) && p('status') && e('active'); // 步骤3:验证Bug对象状态
r($tutorialTest->getBugTest()) && p('type') && e('codeerror'); // 步骤4:验证Bug对象类型
r($tutorialTest->getBugTest()) && p('project') && e('2'); // 步骤5:验证Bug对象项目ID