+ [misc] Add unit tests for tutorialModel::getProgramPairs() 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:27 +08:00
co-authored by Claude
parent 55692f77ea
commit 990579e2ec
2 changed files with 44 additions and 0 deletions
@@ -989,4 +989,19 @@ class tutorialTest
return $result;
}
/**
* 测试获取新手模式项目集键值对。
* Test get program pairs.
*
* @access public
* @return array
*/
public function getProgramPairsTest(): array
{
$result = $this->objectModel->getProgramPairs();
if(dao::isError()) return dao::getError();
return $result;
}
}
+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/env php
<?php
/**
title=测试 tutorialModel::getProgramPairs();
timeout=0
cid=0
- 执行tutorialTest模块的getProgramPairsTest方法 属性1 @Test program
- 执行tutorialTest模块的getProgramPairsTest方法 @1
- 执行tutorialTest模块的getProgramPairsTest方法 @1
- 执行tutorialTest模块的getProgramPairsTest方法 @Test program
- 执行tutorialTest模块的getProgramPairsTest方法 @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->getProgramPairsTest()) && p('1') && e('Test program');
r(count($tutorialTest->getProgramPairsTest())) && p() && e('1');
r(array_keys($tutorialTest->getProgramPairsTest())) && p('0') && e('1');
r(array_values($tutorialTest->getProgramPairsTest())) && p('0') && e('Test program');
r(is_array($tutorialTest->getProgramPairsTest())) && p() && e('1');