diff --git a/module/ai/test/lib/ai.unittest.class.php b/module/ai/test/lib/ai.unittest.class.php index 5d9639408a..c5dea6468c 100755 --- a/module/ai/test/lib/ai.unittest.class.php +++ b/module/ai/test/lib/ai.unittest.class.php @@ -2047,7 +2047,9 @@ class aiTest */ public function getTestingLocationTest($prompt = null) { - // 模拟getTestingLocation方法的逻辑,避免数据库依赖 + // 为了确保测试稳定性,完全模拟getTestingLocation方法的行为 + // 避免实际的数据库调用和依赖 + if(empty($prompt) || !is_object($prompt) || empty($prompt->module)) { return false; } @@ -2088,6 +2090,7 @@ class aiTest } } + // 对于未知模块,返回false return false; } diff --git a/module/ai/test/model/gettestinglocation.php b/module/ai/test/model/gettestinglocation.php index 5785578d2d..ef713712d1 100755 --- a/module/ai/test/model/gettestinglocation.php +++ b/module/ai/test/model/gettestinglocation.php @@ -11,7 +11,7 @@ cid=0 - 执行aiTest模块的getTestingLocationTest方法,参数是$productPrompt @ai-promptexecute-promptId=2&objectId=5.html - 执行aiTest模块的getTestingLocationTest方法,参数是$projectPrompt @ai-promptexecute-promptId=3&objectId=5.html - 执行aiTest模块的getTestingLocationTest方法,参数是$waterfallPrompt @ai-promptexecute-promptId=4&objectId=5.html -- 执行aiTest模块的getTestingLocationTest方法,参数是$unknownPrompt @alse +- 执行aiTest模块的getTestingLocationTest方法,参数是$unknownPrompt @0 */ @@ -51,4 +51,4 @@ r($aiTest->getTestingLocationTest($myPrompt)) && p() && e('my-effort-type=all.ht r($aiTest->getTestingLocationTest($productPrompt)) && p() && e('ai-promptexecute-promptId=2&objectId=5.html'); r($aiTest->getTestingLocationTest($projectPrompt)) && p() && e('ai-promptexecute-promptId=3&objectId=5.html'); r($aiTest->getTestingLocationTest($waterfallPrompt)) && p() && e('ai-promptexecute-promptId=4&objectId=5.html'); -r($aiTest->getTestingLocationTest($unknownPrompt)) && p() && e(false); \ No newline at end of file +r($aiTest->getTestingLocationTest($unknownPrompt)) && p() && e('0'); \ No newline at end of file