znt/module/todo/test/zen/setsessionuri.php

33 lines
1.3 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=测试 todoZen::setSessionUri();
timeout=0
cid=19307
- 步骤1设置有效的URI @1
- 步骤2设置空字符串URI @1
- 步骤3设置带参数的URI @1
- 步骤4设置特殊字符URI @1
- 步骤5设置长URI字符串 @1
*/
// 1. 导入依赖(路径固定,不可修改)
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/todozen.unittest.class.php';
// 2. 用户登录(选择合适角色)
su('admin');
// 3. 创建测试实例(变量名与模块名一致)
$todoTest = new todoTest();
// 4. 🔴 强制要求必须包含至少5个测试步骤
r($todoTest->setSessionUriTest('todo-browse-all-all-all.html')) && p() && e(1); // 步骤1设置有效的URI
r($todoTest->setSessionUriTest('')) && p() && e(1); // 步骤2设置空字符串URI
r($todoTest->setSessionUriTest('todo-browse-all-all-all.html?param=value')) && p() && e(1); // 步骤3设置带参数的URI
r($todoTest->setSessionUriTest('todo-browse-all-all-all.html#anchor')) && p() && e(1); // 步骤4设置特殊字符URI
r($todoTest->setSessionUriTest('very-long-uri-string-with-many-parameters-todo-browse-all-all-all.html?param1=value1&param2=value2&param3=value3')) && p() && e(1); // 步骤5设置长URI字符串