znt/module/testreport/test/zen/buildreportbugdata.php

38 lines
1.8 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=测试 testreportZen::buildReportBugData();
timeout=0
cid=19133
- 步骤1正常情况第1条的foundBugs属性 @7
- 步骤2空任务列表第1条的foundBugs属性 @0
- 步骤3无效时间范围第1条的foundBugs属性 @7
- 步骤4单个任务和产品第1条的foundBugs属性 @7
- 步骤5多个产品和构建的复杂情况第1条的foundBugs属性 @7
*/
// 1. 导入依赖(路径固定,不可修改)
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/testreportzen.unittest.class.php';
// 2. zendata数据准备根据需要配置
zenData('bug');
zenData('build');
zenData('testtask');
// 3. 用户登录(选择合适角色)
su('admin');
// 4. 创建测试实例(变量名与模块名一致)
$testreportTest = new testreportTest();
// 5. 🔴 强制要求必须包含至少5个测试步骤
r($testreportTest->buildReportBugDataTest(array(1 => 1, 2 => 2), array(1 => 1, 2 => 2), '2024-01-01', '2024-01-31', array(1 => 1, 2 => 2))) && p('1:foundBugs') && e('7'); // 步骤1正常情况
r($testreportTest->buildReportBugDataTest(array(), array(1 => 1), '2024-01-01', '2024-01-31', array(1 => 1))) && p('1:foundBugs') && e('0'); // 步骤2空任务列表
r($testreportTest->buildReportBugDataTest(array(1 => 1), array(1 => 1), '2024-02-01', '2024-01-31', array(1 => 1))) && p('1:foundBugs') && e('7'); // 步骤3无效时间范围
r($testreportTest->buildReportBugDataTest(array(1 => 1), array(1 => 1), '2024-01-01', '2024-01-31', array(1 => 1))) && p('1:foundBugs') && e('7'); // 步骤4单个任务和产品
r($testreportTest->buildReportBugDataTest(array(1 => 1, 2 => 2, 3 => 3), array(1 => 1, 2 => 2, 3 => 3), '2024-01-01', '2024-01-31', array(1 => 1, 2 => 2, 3 => 3))) && p('1:foundBugs') && e('7'); // 步骤5多个产品和构建的复杂情况