You are here

function _simpletest_build_summary_line in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/simpletest/simpletest.module \_simpletest_build_summary_line()

Formats each test result type pluralized summary.

Parameters

array $summary: A summary of the test results.

Return value

array The pluralized test summary items.

2 calls to _simpletest_build_summary_line()
template_preprocess_simpletest_result_summary in core/modules/simpletest/simpletest.module
Prepares variables for simpletest result summary templates.
_simpletest_format_summary_line in core/modules/simpletest/simpletest.module
Formats test result summaries into a comma separated string for run-tests.sh.

File

core/modules/simpletest/simpletest.module, line 89
Provides testing functionality.

Code

function _simpletest_build_summary_line($summary) {
  $translation = \Drupal::translation();
  $items['pass'] = $translation
    ->formatPlural($summary['pass'], '1 pass', '@count passes');
  $items['fail'] = $translation
    ->formatPlural($summary['fail'], '1 fail', '@count fails');
  $items['exception'] = $translation
    ->formatPlural($summary['exception'], '1 exception', '@count exceptions');
  if ($summary['debug']) {
    $items['debug'] = $translation
      ->formatPlural($summary['debug'], '1 debug message', '@count debug messages');
  }
  return $items;
}