commit 10e805f46bb87fb3e2c49601a6bdb90beedab6b4 Author: Joel Pittet Date: Tue Feb 26 23:37:05 2013 -0800 1898452-4 diff --git a/core/modules/simpletest/simpletest.pages.inc b/core/modules/simpletest/simpletest.pages.inc index fc7e649..88be639 100644 --- a/core/modules/simpletest/simpletest.pages.inc +++ b/core/modules/simpletest/simpletest.pages.inc @@ -55,7 +55,7 @@ function simpletest_test_form($form) { } /** - * Returns HTML for a test list generated by simpletest_test_form() into a table. + * Preprocess variables for a test list generated by simpletest_test_form() into a table. * * @param $variables * An associative array containing: @@ -63,7 +63,7 @@ function simpletest_test_form($form) { * * @ingroup themeable */ -function template_preprocess_simpletest_test_table($variables) { +function template_preprocess_simpletest_test_table(&$variables) { $table = $variables['table']; drupal_add_library('simpletest', 'drupal.simpletest'); @@ -165,12 +165,13 @@ function template_preprocess_simpletest_test_table($variables) { // Add js array of settings. drupal_add_js(array('simpleTest' => $js), 'setting'); - if (empty($rows)) { - $variables['table'] = '' . t('No tests to display.') . ''; - } - else { - $variables['table'] = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'simpletest-form-table'))); - } + $variables['table'] = array( + '#theme' => 'table', + '#header' => $header, + '#rows' => $rows, + '#empty' => t('No tests to display.'), + '#attributes' => array('id' => 'simpletest-form-table'), + ); } /** @@ -363,7 +364,7 @@ function simpletest_result_form_submit($form, &$form_state) { } /** - * Returns HTML for the summary status of a simpletest result. + * Preprocess variables for the summary status of a simpletest result. * * @param $variables * An associative array containing: @@ -371,8 +372,9 @@ function simpletest_result_form_submit($form, &$form_state) { * * @ingroup themeable */ -function template_preprocess_simpletest_result_summary($variables) { +function template_preprocess_simpletest_result_summary(&$variables) { $form = $variables['form']; + unset($variables['form']); $variables['summary'] = _simpletest_format_summary_line($form); $variables['status'] = $form['#ok'] ? 'pass' : 'fail'; } diff --git a/core/modules/simpletest/templates/simpletest-result-summary.html.twig b/core/modules/simpletest/templates/simpletest-result-summary.html.twig index c8538c1..248595b 100644 --- a/core/modules/simpletest/templates/simpletest-result-summary.html.twig +++ b/core/modules/simpletest/templates/simpletest-result-summary.html.twig @@ -1,14 +1,14 @@ {# /** * @file - * Default theme implementation for the content of simpletest result summary + * Default theme implementation for the content of simpletest result summary. * * Available variables: - * - status: Pass or fail of test - * - summary: Summary info of test + * - status: Pass or fail of test. + * - summary: Summary info of test. * * @see template_preprocess() - * @see template_preprocess_admin_block_content() + * @see template_preprocess_simpletest_result_summary() * * @ingroup themeable */ diff --git a/core/modules/simpletest/templates/simpletest-test-table.html.twig b/core/modules/simpletest/templates/simpletest-test-table.html.twig index c51180c..7c920e6 100644 --- a/core/modules/simpletest/templates/simpletest-test-table.html.twig +++ b/core/modules/simpletest/templates/simpletest-test-table.html.twig @@ -1,15 +1,15 @@ {# /** * @file - * Default theme implementation for the content of simpletest result summary + * Default theme implementation for the content of simpletest test table. * * Available variables: - * - table: A simpletest table + * - table: A simpletest table. * * @see template_preprocess() - * @see template_preprocess_admin_block_content() + * @see template_preprocess_simpletest_test_table() * * @ingroup themeable */ #} -{{ $table }} +{{ table }}