znt/module/ai/test/model/getobjectforpromptbyid.php

32 lines
1.4 KiB
PHP
Executable file
Raw Permalink 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
- 步骤1story模块正常情况返回数组包含两个元素 @2
- 步骤2task模块正常情况返回数组包含两个元素 @2
- 步骤3不存在的prompt ID @0
- 步骤4不存在的object ID @0
- 步骤5空参数测试 @0
- 步骤6product模块测试返回数组包含两个元素 @2
- 步骤7bug模块正常情况 @2
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
$aiTest = new aiModelTest();
r($aiTest->getObjectForPromptByIdTest(1, 1)) && p() && e('2'); // 步骤1story模块正常情况返回数组包含两个元素
r($aiTest->getObjectForPromptByIdTest(3, 1)) && p() && e('2'); // 步骤2task模块正常情况返回数组包含两个元素
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'); // 步骤6product模块测试返回数组包含两个元素
r($aiTest->getObjectForPromptByIdTest(5, 1)) && p() && e('2'); // 步骤7bug模块正常情况