+ [misc] Add unit tests for blockZen::printSingleMonthlyProgressBlock() method

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
liugang
2025-11-12 08:25:47 +08:00
co-authored by Claude
parent 367c5592b9
commit 80437713c9
3 changed files with 136 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
#!/usr/bin/env php
<?php
/**
title=测试 blockZen::printSingleMonthlyProgressBlock();
timeout=0
cid=0
- 执行blockTest模块的printSingleMonthlyProgressBlockTest方法,参数是1 属性doneStoryEstimateCount @6
- 执行blockTest模块的printSingleMonthlyProgressBlockTest方法,参数是2 属性doneStoryCountCount @6
- 执行blockTest模块的printSingleMonthlyProgressBlockTest方法,参数是3 属性createStoryCountCount @6
- 执行blockTest模块的printSingleMonthlyProgressBlockTest方法,参数是4 属性fixedBugCountCount @6
- 执行blockTest模块的printSingleMonthlyProgressBlockTest方法,参数是5 属性createBugCountCount @6
- 执行blockTest模块的printSingleMonthlyProgressBlockTest方法,参数是6 属性releaseCountCount @6
- 执行blockTest模块的printSingleMonthlyProgressBlockTest方法,参数是7
- 属性doneStoryEstimateCount @6
- 属性doneStoryCountCount @6
- 属性createStoryCountCount @6
- 属性fixedBugCountCount @6
- 属性createBugCountCount @6
- 属性releaseCountCount @6
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/zen.class.php';
zendata('product')->loadYaml('printsinglemonthlyprogressblock', false, 2)->gen(10);
zendata('metriclib')->loadYaml('printsinglemonthlyprogressblock', false, 2)->gen(6);
su('admin');
$blockTest = new blockZenTest();
r($blockTest->printSingleMonthlyProgressBlockTest(1)) && p('doneStoryEstimateCount') && e('6');
r($blockTest->printSingleMonthlyProgressBlockTest(2)) && p('doneStoryCountCount') && e('6');
r($blockTest->printSingleMonthlyProgressBlockTest(3)) && p('createStoryCountCount') && e('6');
r($blockTest->printSingleMonthlyProgressBlockTest(4)) && p('fixedBugCountCount') && e('6');
r($blockTest->printSingleMonthlyProgressBlockTest(5)) && p('createBugCountCount') && e('6');
r($blockTest->printSingleMonthlyProgressBlockTest(6)) && p('releaseCountCount') && e('6');
r($blockTest->printSingleMonthlyProgressBlockTest(7)) && p('doneStoryEstimateCount,doneStoryCountCount,createStoryCountCount,fixedBugCountCount,createBugCountCount,releaseCountCount') && e('6,6,6,6,6,6');
@@ -0,0 +1,40 @@
---
title: 度量项库数据定义
desc: 用于测试printSingleMonthlyProgressBlock方法的度量项库数据
fields:
- field: id
note: 度量项ID
range: 1-6
prefix: ""
postfix: ""
loop: 0
format: ""
- field: code
note: 度量项代码
range: scale_of_monthly_finished_story_in_product,count_of_monthly_created_story_in_product,count_of_monthly_finished_story_in_product,count_of_monthly_created_bug_in_product,count_of_monthly_fixed_bug_in_product,count_of_monthly_created_release_in_product
prefix: ""
postfix: ""
loop: 0
format: ""
- field: name
note: 度量项名称
range: 产品月度完成需求规模,产品月度新增需求数,产品月度完成需求数,产品月度新增Bug数,产品月度修复Bug数,产品月度发布数
prefix: ""
postfix: ""
loop: 0
format: ""
- field: purpose
note: 度量目的
range: scale{6}
prefix: ""
postfix: ""
loop: 0
format: ""
- field: deleted
note: 是否删除
range: 0
prefix: ""
postfix: ""
loop: 0
format: ""
@@ -0,0 +1,54 @@
---
title: 产品数据定义
desc: 用于测试printSingleMonthlyProgressBlock方法的产品数据
fields:
- field: id
note: 产品ID
range: 1-10
prefix: ""
postfix: ""
loop: 0
format: ""
- field: program
note: 项目集ID
range: 1-3
prefix: ""
postfix: ""
loop: 0
format: ""
- field: name
note: 产品名称
range: 产品1,产品2,产品3,产品4,产品5,产品6,产品7,产品8,产品9,产品10
prefix: ""
postfix: ""
loop: 0
format: ""
- field: code
note: 产品代号
range: product1,product2,product3,product4,product5,product6,product7,product8,product9,product10
prefix: ""
postfix: ""
loop: 0
format: ""
- field: type
note: 产品类型
range: normal
prefix: ""
postfix: ""
loop: 0
format: ""
- field: status
note: 产品状态
range: normal
prefix: ""
postfix: ""
loop: 0
format: ""
- field: deleted
note: 是否删除
range: 0
prefix: ""
postfix: ""
loop: 0
format: ""