Blame view

framework/library/testify/helpers.php 282 Bytes
4d84a934   曹明   初始代码提交
1
2
3
4
5
6
7
8
9
10
11
12
<?php

/**
 * Calculate the percentage of success for a test
 *
 * @param array $suiteResults
 * @return float Percent
 */
function percent($suiteResults) {
    $sum = $suiteResults['pass'] + $suiteResults['fail'];
    return round($suiteResults['pass'] * 100 / max($sum, 1), 2);
}