znt/module/repo/test/model/iconvcomment.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=测试 repoModel::iconvComment();
timeout=0
cid=18084
- 测试步骤1空编码参数情况 @test comment
- 测试步骤2UTF-8编码转换情况 @utf-8 test
- 测试步骤3GBK编码转换有效字符串 @测试中文
- 测试步骤4多编码列表转换情况 @multi test
- 测试步骤5无效编码参数情况 @invalid test
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
su('admin');
$repo = new repoModelTest();
r($repo->iconvCommentTest('test comment', '')) && p() && e('test comment'); // 测试步骤1空编码参数情况
r($repo->iconvCommentTest('utf-8 test', 'utf-8')) && p() && e('utf-8 test'); // 测试步骤2UTF-8编码转换情况
r($repo->iconvCommentTest('测试中文', 'GBK')) && p() && e('测试中文'); // 测试步骤3GBK编码转换有效字符串
r($repo->iconvCommentTest('multi test', 'iso-8859-1,GBK,GB2312')) && p() && e('multi test'); // 测试步骤4多编码列表转换情况
r($repo->iconvCommentTest('invalid test', 'invalid-encoding')) && p() && e('invalid test'); // 测试步骤5无效编码参数情况