znt/module/pivot/test/model/processdtablecols.php

41 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=测试 pivotModel::processDTableCols();
timeout=0
cid=17417
- 执行$result1) && is_array($result1 @1
- 执行$result2) && is_array($result2 @1
- 执行$result3 @1
- 执行$result4) && is_array($result4 @1
- 执行$result5) && is_array($result5 @1
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
$pivotTest = new pivotModelTest();
// 测试1多列输入验证返回数组不为空
$result1 = $pivotTest->processDTableColsTest(array('id' => array('title' => 'ID'), 'name' => array('title' => '名称'), 'status' => array('title' => '状态')));
r(!empty($result1) && is_array($result1)) && p() && e('1');
// 测试2单列输入验证返回数组不为空
$result2 = $pivotTest->processDTableColsTest(array('id' => array('title' => 'ID')));
r(!empty($result2) && is_array($result2)) && p() && e('1');
// 测试3空输入验证返回数组
$result3 = $pivotTest->processDTableColsTest(array());
r(is_array($result3)) && p() && e('1');
// 测试4特殊字符测试
$result4 = $pivotTest->processDTableColsTest(array('field_@#' => array('title' => 'Title@#$')));
r(!empty($result4) && is_array($result4)) && p() && e('1');
// 测试5中文标题测试
$result5 = $pivotTest->processDTableColsTest(array('项目' => array('title' => '项目管理')));
r(!empty($result5) && is_array($result5)) && p() && e('1');