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

38 lines
1.5 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::deleteHistoryMessagesByID();
timeout=0
cid=15017
- 执行aiTest模块的deleteHistoryMessagesByIDTest方法参数是1, 1, array @0
- 执行aiTest模块的deleteHistoryMessagesByIDTest方法参数是2, 2, array @0
- 执行aiTest模块的deleteHistoryMessagesByIDTest方法参数是999, 1, array @0
- 执行aiTest模块的deleteHistoryMessagesByIDTest方法参数是1, 999, array @0
- 执行aiTest模块的deleteHistoryMessagesByIDTest方法参数是1, 1, array @0
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
$table = zenData('ai_message');
$table->id->range('1-20');
$table->appID->range('1{10},2{5},3{5}');
$table->user->range('1{8},2{6},3{6}');
$table->type->range('req{8},res{8},ntf{4}');
$table->content->range('测试消息内容1{5},测试消息内容2{5},测试消息内容3{5},测试消息内容4{5}');
$table->createdDate->range('`2024-09-01 10:00:00`');
$table->gen(20);
su('admin');
$aiTest = new aiModelTest();
r($aiTest->deleteHistoryMessagesByIDTest(1, 1, array(1, 2, 3))) && p() && e('0');
r($aiTest->deleteHistoryMessagesByIDTest(2, 2, array())) && p() && e('0');
r($aiTest->deleteHistoryMessagesByIDTest(999, 1, array(1, 2))) && p() && e('0');
r($aiTest->deleteHistoryMessagesByIDTest(1, 999, array(1, 2))) && p() && e('0');
r($aiTest->deleteHistoryMessagesByIDTest(1, 1, array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10))) && p() && e('0');