+ [misc] Add unit tests for tutorialModel::getPlan() 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 e36869b9c5
commit eceb49541d
2 changed files with 44 additions and 0 deletions
@@ -871,4 +871,19 @@ class tutorialTest
return $result;
}
/**
* 测试获取新手模式计划。
* Test get plan.
*
* @access public
* @return object
*/
public function getPlanTest(): object
{
$result = $this->objectModel->getPlan();
if(dao::isError()) return dao::getError();
return $result;
}
}
+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/env php
<?php
/**
title=测试 tutorialModel::getPlan();
timeout=0
cid=0
- 执行tutorialTest模块的getPlanTest方法 属性id @1
- 执行tutorialTest模块的getPlanTest方法 属性title @Test plan
- 执行tutorialTest模块的getPlanTest方法 属性status @wait
- 执行tutorialTest模块的getPlanTest方法 属性product @1
- 执行tutorialTest模块的getPlanTest方法 属性createdBy @admin
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/tutorial.unittest.class.php';
su('admin');
$tutorialTest = new tutorialTest();
r($tutorialTest->getPlanTest()) && p('id') && e('1');
r($tutorialTest->getPlanTest()) && p('title') && e('Test plan');
r($tutorialTest->getPlanTest()) && p('status') && e('wait');
r($tutorialTest->getPlanTest()) && p('product') && e('1');
r($tutorialTest->getPlanTest()) && p('createdBy') && e('admin');