znt/module/convert/test/model/tableexists.php

33 lines
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=测试 convertModel::tableExists();
timeout=0
cid=15797
- 步骤1检查存在的系统表user @1
- 步骤2检查存在的表名bug @1
- 步骤3检查存在的表名task @1
- 步骤4检查不存在的表名 @0
- 步骤5检查空字符串表名 @1
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
su('admin');
global $tester;
$tester->loadModel('convert');
$convertTest = new convertModelTest();
r(!!$convertTest->tableExistsTest('zt_user')) && p() && e('1'); // 步骤1检查存在的系统表user
r(!!$convertTest->tableExistsTest('zt_bug')) && p() && e('1'); // 步骤2检查存在的表名bug
r(!!$convertTest->tableExistsTest('zt_task')) && p() && e('1'); // 步骤3检查存在的表名task
r(!!$convertTest->tableExistsTest('zt_nonexistent_table_12345')) && p() && e('0'); // 步骤4检查不存在的表名
r(!!$convertTest->tableExistsTest('')) && p() && e('1'); // 步骤5检查空字符串表名