本文整理汇总了PHP中pts_strings::result_quantifier_to_string方法的典型用法代码示例。如果您正苦于以下问题:PHP pts_strings::result_quantifier_to_string方法的具体用法?PHP pts_strings::result_quantifier_to_string怎么用?PHP pts_strings::result_quantifier_to_string使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pts_strings
的用法示例。
在下文中一共展示了pts_strings::result_quantifier_to_string方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_run_end
public function test_run_end(&$test_result)
{
$end_print = $test_result->test_profile->get_title() . ':' . PHP_EOL . $test_result->get_arguments_description();
$end_print .= PHP_EOL . ($test_result->get_arguments_description() != null ? PHP_EOL : null);
if (in_array($test_result->test_profile->get_display_format(), array('NO_RESULT', 'FILLED_LINE_GRAPH', 'LINE_GRAPH', 'IMAGE_COMPARISON'))) {
return;
} else {
if (in_array($test_result->test_profile->get_display_format(), array('PASS_FAIL', 'MULTI_PASS_FAIL'))) {
$end_print .= PHP_EOL . 'Final: ' . $test_result->active->get_result() . ' (' . $test_result->test_profile->get_result_scale() . ')' . PHP_EOL;
} else {
foreach ($test_result->active->results as $result) {
$end_print .= $result . ' ' . $test_result->test_profile->get_result_scale() . PHP_EOL;
}
$end_print .= PHP_EOL . pts_strings::result_quantifier_to_string($test_result->test_profile->get_result_quantifier()) . ': ' . $test_result->active->get_result() . ' ' . $test_result->test_profile->get_result_scale();
}
}
echo self::string_header($end_print, '#');
}
示例2: test_run_end
public function test_run_end(&$test_result)
{
echo PHP_EOL;
if (in_array($test_result->test_profile->get_display_format(), array('NO_RESULT', 'IMAGE_COMPARISON'))) {
$end_print = null;
} else {
if (in_array($test_result->test_profile->get_display_format(), array('PASS_FAIL', 'MULTI_PASS_FAIL'))) {
$end_print = $this->tab . $this->tab . 'Final: ' . $test_result->get_result() . ' (' . $test_result->test_profile->get_result_scale() . ')' . PHP_EOL;
} else {
if (in_array($test_result->test_profile->get_display_format(), array('FILLED_LINE_GRAPH', 'LINE_GRAPH'))) {
$values = explode(',', $test_result->get_result());
$end_print = null;
if (count($values) > 1) {
$avg = pts_math::set_precision(array_sum($values) / count($values), 2);
$min = pts_math::set_precision(min($values), 2);
$max = pts_math::set_precision(max($values), 2);
$end_print .= $this->tab . $this->tab . 'Average: ' . $avg . ' (' . $test_result->test_profile->get_result_scale() . ')' . PHP_EOL;
$end_print .= $this->tab . $this->tab . 'Minimum: ' . $min . ' (' . $test_result->test_profile->get_result_scale() . ')' . PHP_EOL;
$end_print .= $this->tab . $this->tab . 'Maximum: ' . $max . ' (' . $test_result->test_profile->get_result_scale() . ')' . PHP_EOL;
}
} else {
$end_print = PHP_EOL . $this->tab . 'Test Results:' . PHP_EOL;
foreach ($test_result->test_result_buffer->get_values() as $result) {
$end_print .= $this->tab . $this->tab . $result . PHP_EOL;
}
$end_print .= PHP_EOL . $this->tab . pts_strings::result_quantifier_to_string($test_result->test_profile->get_result_quantifier()) . ': ' . $test_result->get_result() . ' ' . $test_result->test_profile->get_result_scale();
if ($test_result->get_min_result()) {
$end_print .= PHP_EOL . $this->tab . 'Minimum: ' . $test_result->get_min_result();
}
if ($test_result->get_max_result()) {
$end_print .= PHP_EOL . $this->tab . 'Maximum: ' . $test_result->get_max_result();
}
if ($test_result->get_result() == 0) {
$end_print .= PHP_EOL . $this->tab . 'This test failed to run properly.';
}
$end_print .= PHP_EOL;
}
}
}
echo $end_print;
}
示例3: test_run_end
public function test_run_end(&$test_result)
{
$test_run_manager = null;
$this->update_benchmark_status($test_run_manager, $test_result);
// TODO XXX: DO THIS
echo PHP_EOL;
if (!in_array($test_result->test_profile->get_display_format(), array('NO_RESULT', 'IMAGE_COMPARISON', 'PASS_FAIL', 'MULTI_PASS_FAIL', 'FILLED_LINE_GRAPH', 'LINE_GRAPH'))) {
// TODO XXX: At least implement line_graph support as may be fairly popular
$end_print = PHP_EOL . $this->tab . 'Test Results:' . PHP_EOL;
foreach ($test_result->active->results as $result) {
$end_print .= $this->tab . $this->tab . $result . PHP_EOL;
}
$end_print .= PHP_EOL . $this->tab . pts_strings::result_quantifier_to_string($test_result->test_profile->get_result_quantifier()) . ': ' . $test_result->active->get_result() . ' ' . $test_result->test_profile->get_result_scale();
if ($test_result->active->get_min_result()) {
$end_print .= PHP_EOL . $this->tab . 'Minimum: ' . $test_result->active->get_min_result();
}
if ($test_result->active->get_max_result()) {
$end_print .= PHP_EOL . $this->tab . 'Maximum: ' . $test_result->active->get_max_result();
}
if ($test_result->active->get_result() == 0) {
$end_print .= PHP_EOL . $this->tab . 'This test failed to run properly.';
}
$end_print .= PHP_EOL;
}
echo $end_print;
}
示例4: test_run_end
public function test_run_end(&$test_result)
{
if (in_array($test_result->test_profile->get_display_format(), array('NO_RESULT', 'IMAGE_COMPARISON'))) {
$end_print = null;
} else {
if (in_array($test_result->test_profile->get_display_format(), array('PASS_FAIL', 'MULTI_PASS_FAIL'))) {
$end_print = 'Final: ' . $test_result->get_result() . ' (' . $test_result->test_profile->get_result_scale() . ')';
} else {
if (in_array($test_result->test_profile->get_display_format(), array('FILLED_LINE_GRAPH', 'LINE_GRAPH'))) {
$values = explode(',', $test_result->get_result());
$end_print = null;
if (count($values) > 1) {
$avg = pts_math::set_precision(array_sum($values) / count($values), 2);
$min = pts_math::set_precision(min($values), 2);
$max = pts_math::set_precision(max($values), 2);
$end_print .= 'AVG: ' . $avg . ' (' . $test_result->test_profile->get_result_scale() . ') / ';
$end_print .= 'MIN: ' . $min . ' (' . $test_result->test_profile->get_result_scale() . ') / ';
$end_print .= 'MAX: ' . $max . ' (' . $test_result->test_profile->get_result_scale() . ') / ';
}
} else {
$end_print = pts_strings::result_quantifier_to_string($test_result->test_profile->get_result_quantifier()) . ': ' . $test_result->get_result() . ' ' . $test_result->test_profile->get_result_scale();
}
}
}
echo $this->print_test_identifier_prefix($test_result) . $end_print;
}