+ [misc] Add unit tests for tutorialModel::getLibTree() 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 497c38b382
commit ba5507a679
2 changed files with 51 additions and 0 deletions
@@ -1166,4 +1166,18 @@ class tutorialTest
return $result;
}
/**
* Test getLibTree method.
*
* @access public
* @return array
*/
public function getLibTreeTest(): array
{
$result = $this->objectModel->getLibTree();
if(dao::isError()) return dao::getError();
return $result;
}
}
+37
View File
@@ -0,0 +1,37 @@
#!/usr/bin/env php
<?php
/**
title=测试 tutorialModel::getLibTree();
timeout=0
cid=0
- 执行tutorialTest模块的getLibTreeTest方法 @1
- 执行tutorialTest模块的getLibTreeTest方法
- 第0条的id属性 @2
- 第0条的name属性 @Test Doc Lib
- 执行tutorialTest模块的getLibTreeTest方法
- 第0条的type属性 @docLib
- 第0条的parent属性 @1
- 执行tutorialTest模块的getLibTreeTest方法
- 第0条的objectType属性 @custom
- 第0条的active属性 @1
- 执行tutorialTest模块的getLibTreeTest方法
- 第0条的order属性 @0
- 第0条的main属性 @0
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/tutorial.unittest.class.php';
su('admin');
$tutorialTest = new tutorialTest();
r(count($tutorialTest->getLibTreeTest())) && p() && e('1');
r($tutorialTest->getLibTreeTest()) && p('0:id,name') && e('2,Test Doc Lib');
r($tutorialTest->getLibTreeTest()) && p('0:type,parent') && e('docLib,1');
r($tutorialTest->getLibTreeTest()) && p('0:objectType,active') && e('custom,1');
r($tutorialTest->getLibTreeTest()) && p('0:order,main') && e('0,0');