Commit 971135d0 authored by catch's avatar catch
Browse files

Issue #1813286 by sun: _simpletest_format_summary_line() should not use t().

parent cad040a5
......@@ -233,7 +233,7 @@ function confirmStubTestResults() {
$this->assertAssertion("Debug: 'Foo'", 'Debug', 'Fail', 'SimpleTestTest.php', 'Drupal\simpletest\Tests\SimpleTestTest->stubTest()');
$this->assertEqual('6 passes, 5 fails, 2 exceptions, and 1 debug message', $this->childTestResults['summary'], 'Stub test summary is correct');
$this->assertEqual('6 passes, 5 fails, 2 exceptions, 1 debug message', $this->childTestResults['summary'], 'Stub test summary is correct');
$this->test_ids[] = $test_id = $this->getTestIdFromResults();
$this->assertTrue($test_id, 'Found test ID in results.');
......
......@@ -103,16 +103,14 @@ function simpletest_js_alter(&$javascript) {
}
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);
$parts = array();
$parts[] = $summary['#pass'] == 1 ? '1 pass' : $summary['#pass'] . ' passes';
$parts[] = $summary['#fail'] == 1 ? '1 fail' : $summary['#fail'] . ' fails';
$parts[] = $summary['#exception'] == 1 ? '1 exception' : $summary['#exception'] . ' exceptions';
if ($summary['#debug']) {
$parts[] = $summary['#debug'] == 1 ? '1 debug message' : $summary['#debug'] . ' debug messages';
}
return implode(', ', $parts);
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment