znt/module/programplan/test/zen/buildajaxcustomview.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=测试 programplanZen::buildAjaxCustomView();
timeout=0
cid=17785
- 步骤1正常情况属性customFields @2
- 步骤2空用户参数属性stageCustom @~~
- 步骤3空模块参数属性stageCustom @~~
- 步骤4空自定义字段参数属性customFields @0
- 步骤5不存在的用户配置属性customFields @2
*/
// 1. 导入依赖(路径固定,不可修改)
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/zen.class.php';
// 2. 用户登录(选择合适角色)
su('admin');
// 3. 创建测试实例(变量名与模块名一致)
$programplanTest = new programplanZenTest();
// 4. 🔴 强制要求必须包含至少5个测试步骤
r($programplanTest->buildAjaxCustomViewTest('admin', 'programplan', array('name' => '阶段名称', 'percent' => '工作量'))) && p('customFields') && e('2'); // 步骤1正常情况
r($programplanTest->buildAjaxCustomViewTest('', 'programplan', array('name' => '阶段名称'))) && p('stageCustom') && e('~~'); // 步骤2空用户参数
r($programplanTest->buildAjaxCustomViewTest('admin', '', array('name' => '阶段名称'))) && p('stageCustom') && e('~~'); // 步骤3空模块参数
r($programplanTest->buildAjaxCustomViewTest('admin', 'programplan', array())) && p('customFields') && e('0'); // 步骤4空自定义字段参数
r($programplanTest->buildAjaxCustomViewTest('nonexistuser', 'programplan', array('begin' => '开始日期', 'end' => '结束日期'))) && p('customFields') && e('2'); // 步骤5不存在的用户配置