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

29 lines
1.1 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=测试 AIResponseException::__construct();
timeout=0
cid=14994
- 执行aiTest模块的__constructTest方法参数是'invalid_format', 'test response' @1
- 执行aiTest模块的__constructTest方法参数是'parse_error', array @1
- 执行aiTest模块的__constructTest方法参数是'', 'empty type test' @1
- 执行aiTest模块的__constructTest方法参数是'unknown_error', 'unknown response' @1
- 执行aiTest模块的__constructTest方法参数是'special_chars', 'special characters' @1
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
su('admin');
$aiTest = new aiModelTest();
r($aiTest->__constructTest('invalid_format', 'test response')) && p() && e('1');
r($aiTest->__constructTest('parse_error', array('error' => 'parsing failed'))) && p() && e('1');
r($aiTest->__constructTest('', 'empty type test')) && p() && e('1');
r($aiTest->__constructTest('unknown_error', 'unknown response')) && p() && e('1');
r($aiTest->__constructTest('special_chars', 'special characters')) && p() && e('1');