+ [misc] Add unit tests for tutorialModel::getProgram() method
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1004,4 +1004,19 @@ class tutorialTest
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试获取新手模式项目集。
|
||||
* Test get program.
|
||||
*
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getProgramTest(): object
|
||||
{
|
||||
$result = $this->objectModel->getProgram();
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 tutorialModel::getProgram();
|
||||
timeout=0
|
||||
cid=0
|
||||
|
||||
- 执行tutorialTest模块的getProgramTest方法 属性id @1
|
||||
- 执行tutorialTest模块的getProgramTest方法 属性name @Test program
|
||||
- 执行tutorialTest模块的getProgramTest方法 属性type @program
|
||||
- 执行tutorialTest模块的getProgramTest方法 属性parent @0
|
||||
- 执行tutorialTest模块的getProgramTest方法 属性grade @1
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/tutorial.unittest.class.php';
|
||||
|
||||
su('admin');
|
||||
|
||||
$tutorialTest = new tutorialTest();
|
||||
|
||||
r($tutorialTest->getProgramTest()) && p('id') && e('1');
|
||||
r($tutorialTest->getProgramTest()) && p('name') && e('Test program');
|
||||
r($tutorialTest->getProgramTest()) && p('type') && e('program');
|
||||
r($tutorialTest->getProgramTest()) && p('parent') && e('0');
|
||||
r($tutorialTest->getProgramTest()) && p('grade') && e('1');
|
||||
Reference in New Issue
Block a user