znt/module/action/test/model/buildtrashsearchform.php

33 lines
1.6 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=测试 actionModel::buildTrashSearchForm();
timeout=0
cid=14879
- 步骤1正常情况属性actionURL @action-trash-browseTrash-all-byQuery-123.html
- 步骤2queryID为0边界值属性queryID @0
- 步骤3空字符串actionURL属性actionURL @~~
- 步骤4包含特殊字符的actionURL属性queryID @789
- 步骤5负数queryID属性actionURL @action-trash-browseTrash-all-byQuery--1.html
*/
// 1. 导入依赖(路径固定,不可修改)
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
// 2. 用户登录(选择合适角色)
su('admin');
// 3. 创建测试实例(变量名与模块名一致)
$actionTest = new actionModelTest();
// 4. 强制要求必须包含至少5个测试步骤
r($actionTest->buildTrashSearchFormTest(123, 'action-trash-browseTrash-all-byQuery-123.html')) && p('actionURL') && e('action-trash-browseTrash-all-byQuery-123.html'); // 步骤1正常情况
r($actionTest->buildTrashSearchFormTest(0, 'action-trash-browseTrash-all-byQuery-0.html')) && p('queryID') && e('0'); // 步骤2queryID为0边界值
r($actionTest->buildTrashSearchFormTest(456, '')) && p('actionURL') && e('~~'); // 步骤3空字符串actionURL
r($actionTest->buildTrashSearchFormTest(789, 'action-trash-browseTrash-all-byQuery-789.html?param=value&other=test')) && p('queryID') && e('789'); // 步骤4包含特殊字符的actionURL
r($actionTest->buildTrashSearchFormTest(-1, 'action-trash-browseTrash-all-byQuery--1.html')) && p('actionURL') && e('action-trash-browseTrash-all-byQuery--1.html'); // 步骤5负数queryID