1 simpletest.module _simpletest_format_summary_line($summary)

File

core/modules/simpletest/simpletest.module, line 117
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']) {
    $message = t('@pass, @fail, and @exception.', $args);
  }
  else {
    $args['@debug'] = format_plural(isset($summary['#debug']) ? $summary['#debug'] : 0, '1 debug message', '@count debug messages');
    $message = t('@pass, @fail, @exception, and @debug.', $args);
  }
  if (isset($summary['#duration'])) {
    $message .= ' [' . $summary['#duration'] . 's]';
  }
  return $message;
}