function _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 98

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

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