function _simpletest_format_summary_line

Same name in other branches
  1. 8.9.x core/modules/simpletest/simpletest.module \_simpletest_format_summary_line()
2 calls to _simpletest_format_summary_line()
theme_simpletest_result_summary in modules/simpletest/simpletest.pages.inc
Returns HTML for the summary status of a simpletest result.
_simpletest_batch_operation in modules/simpletest/simpletest.module
Implements callback_batch_operation().

File

modules/simpletest/simpletest.module, line 103

Code

function _simpletest_format_summary_line($summary) {
    $args = array(
        '@pass' => format_plural(isset($summary['#pass']) ? $summary['#pass'] : 0, '1 pass', '@count passes'),
        '@fail' => format_plural(isset($summary['#fail']) ? $summary['#fail'] : 0, '1 fail', '@count fails'),
        '@exception' => format_plural(isset($summary['#exception']) ? $summary['#exception'] : 0, '1 exception', '@count exceptions'),
    );
    if (!$summary['#debug']) {
        return t('@pass, @fail, and @exception', $args);
    }
    $args['@debug'] = format_plural(isset($summary['#debug']) ? $summary['#debug'] : 0, '1 debug message', '@count debug messages');
    return t('@pass, @fail, @exception, and @debug', $args);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.