You are here

function _simpletest_format_summary_line in Drupal 7

Same name and namespace in other branches
  1. 8 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
Provides testing functionality.

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);
}