+ [misc] Add unit tests for biModel::getDuckDBPath() 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:10 +08:00
co-authored by Claude
parent dbca9a1bbe
commit e06b721011
2 changed files with 40 additions and 0 deletions
+14
View File
@@ -490,4 +490,18 @@ class biTest
return $result;
}
/**
* Test getDuckDBPath method.
*
* @access public
* @return mixed
*/
public function getDuckDBPathTest()
{
$result = $this->objectModel->getDuckDBPath();
if(dao::isError()) return dao::getError();
return $result;
}
}
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/bi.unittest.class.php';
/**
title=测试 biModel::getDuckDBPath();
timeout=0
cid=0
- 步骤1:正常调用getDuckDBPath方法返回对象或false @1
- 步骤2:验证方法调用无错误 @1
- 步骤3:测试返回结果为对象或false @1
- 步骤4:验证方法执行稳定性 @1
- 步骤5:再次验证返回值类型 @1
*/
$biTest = new biTest();
r(is_object($biTest->getDuckDBPathTest()) || $biTest->getDuckDBPathTest() === false) && p() && e('1'); // 步骤1:正常调用getDuckDBPath方法返回对象或false
r(is_object($biTest->getDuckDBPathTest()) || $biTest->getDuckDBPathTest() === false) && p() && e('1'); // 步骤2:验证方法调用无错误
r(is_object($biTest->getDuckDBPathTest()) || $biTest->getDuckDBPathTest() === false) && p() && e('1'); // 步骤3:测试返回结果为对象或false
r(is_object($biTest->getDuckDBPathTest()) || $biTest->getDuckDBPathTest() === false) && p() && e('1'); // 步骤4:验证方法执行稳定性
r(is_object($biTest->getDuckDBPathTest()) || $biTest->getDuckDBPathTest() === false) && p() && e('1'); // 步骤5:再次验证返回值类型