znt/module/bi/test/model/getactionsyncsql.php

28 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
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
/**
title=测试 biModel::getActionSyncSql();
timeout=0
cid=15160
- 步骤1测试当前月份范围返回数组且长度为1 @1
- 步骤2测试当前月份范围返回数组类型验证 @1
- 步骤3测试无效参数当作current处理 @1
- 步骤4测试默认参数等同current @1
- 步骤5验证SQL语句包含正确结构 @1
*/
$biTest = new biModelTest();
r(is_array($biTest->getActionSyncSqlTest('current')) && count($biTest->getActionSyncSqlTest('current')) == 1) && p() && e('1'); // 步骤1测试当前月份范围返回数组且长度为1
r(is_array($biTest->getActionSyncSqlTest('current'))) && p() && e('1'); // 步骤2测试当前月份范围返回数组类型验证
r(is_array($biTest->getActionSyncSqlTest('invalid')) && count($biTest->getActionSyncSqlTest('invalid')) == 1) && p() && e('1'); // 步骤3测试无效参数当作current处理
r(is_array($biTest->getActionSyncSqlTest()) && count($biTest->getActionSyncSqlTest()) == 1) && p() && e('1'); // 步骤4测试默认参数等同current
$result = $biTest->getActionSyncSqlTest('current');
$sql = current($result);
r(strpos($sql, 'select * from zt_action where') !== false && strpos($sql, 'TIMESTAMP') !== false) && p() && e('1'); // 步骤5验证SQL语句包含正确结构