znt/module/block/test/zen/printexecutionoverviewblock.php

43 lines
1.7 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=测试 blockZen::printExecutionOverviewBlock();
timeout=0
cid=15262
- 步骤1正常情况 @2
- 步骤2指定项目ID属性project @1
- 步骤3不同code参数属性code @sprint
- 步骤4空block对象 @2
- 步骤5showClosed参数属性showClosed @1
*/
// 1. 导入依赖(路径固定,不可修改)
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/zen.class.php';
// 2. zendata数据准备根据需要配置
$metriclib = zenData('metriclib');
$metriclib->id->range('1-20');
$metriclib->metricCode->range('count_of_execution,count_of_annual_finished_execution,count_wait_execution,count_of_doing_execution,count_of_suspended_execution');
$metriclib->value->range('10-50');
$metriclib->date->range('2024-01-01:2024-12-31');
$metriclib->year->range('2024');
$metriclib->month->range('01-12');
$metriclib->gen(20);
// 3. 用户登录(选择合适角色)
su('admin');
// 4. 创建测试实例(变量名与模块名一致)
$blockTest = new blockZenTest();
// 5. 🔴 强制要求必须包含至少5个测试步骤
r(count($blockTest->printExecutionOverviewBlockTest()->groups)) && p() && e('2'); // 步骤1正常情况
r($blockTest->printExecutionOverviewBlockTest(null, array(), 'executionoverview', 1)) && p('project') && e('1'); // 步骤2指定项目ID
r($blockTest->printExecutionOverviewBlockTest(null, array(), 'sprint')) && p('code') && e('sprint'); // 步骤3不同code参数
r(count($blockTest->printExecutionOverviewBlockTest(new stdclass())->groups)) && p() && e('2'); // 步骤4空block对象
r($blockTest->printExecutionOverviewBlockTest(null, array(), 'executionoverview', 0, true)) && p('showClosed') && e('1'); // 步骤5showClosed参数