Files
EasySoft-ZenTaoPMS/module/ai/test/model/getobjectforpromptbyid.php
T
2025-11-14 13:05:25 +08:00

32 lines
1.4 KiB
PHP
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env php
<?php
/**
title=测试 aiModel::getObjectForPromptById();
timeout=0
cid=15042
- 步骤1:story模块正常情况,返回数组包含两个元素 @2
- 步骤2:task模块正常情况,返回数组包含两个元素 @2
- 步骤3:不存在的prompt ID @0
- 步骤4:不存在的object ID @0
- 步骤5:空参数测试 @0
- 步骤6:product模块测试,返回数组包含两个元素 @2
- 步骤7:bug模块正常情况 @2
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/ai.unittest.class.php';
$aiTest = new aiTest();
r($aiTest->getObjectForPromptByIdTest(1, 1)) && p() && e('2'); // 步骤1:story模块正常情况,返回数组包含两个元素
r($aiTest->getObjectForPromptByIdTest(3, 1)) && p() && e('2'); // 步骤2:task模块正常情况,返回数组包含两个元素
r($aiTest->getObjectForPromptByIdTest(99, 1)) && p() && e('0'); // 步骤3:不存在的prompt ID
r($aiTest->getObjectForPromptByIdTest(1, 999)) && p() && e('0'); // 步骤4:不存在的object ID
r($aiTest->getObjectForPromptByIdTest('', '')) && p() && e('0'); // 步骤5:空参数测试
r($aiTest->getObjectForPromptByIdTest(7, 1)) && p() && e('2'); // 步骤6:product模块测试,返回数组包含两个元素
r($aiTest->getObjectForPromptByIdTest(5, 1)) && p() && e('2'); // 步骤7:bug模块正常情况