* Add unit test for metric.

This commit is contained in:
zhouxin
2023-08-02 15:46:32 +08:00
parent 0873319df6
commit 9650f03f77
@@ -0,0 +1,20 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 7) . '/test/lib/init.php';
include dirname(__FILE__, 4) . '/calc.class.php';
zdTable('product')->config('product', $useCommon = true, $levels = 4)->gen(10);
zdTable('story')->config('story_status_closedreason', $useCommon = true, $levels = 4)->gen(1000);
$metric = new metricTest();
$calc = $metric->calcMetric(__FILE__);
/**
title=rate_of_delivered_story
timeout=0
cid=1
*/
r($calc->getResult()) && p('0:value') && e('0.4035'); // 测试按全局统计的研发需求交付率