diff --git a/.htaccess b/.htaccess index 1e08407..0cb1480 100644 --- a/.htaccess +++ b/.htaccess @@ -107,7 +107,7 @@ DirectoryIndex index.php index.html index.htm # # If your site is running in a VirtualDocumentRoot at http://example.com/, # uncomment the following line: - # RewriteBase / + RewriteBase / # Redirect common PHP files to their new locations. RewriteCond %{REQUEST_URI} ^(.*)?/(update.php) [OR] diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module index 760947f..d88b528 100644 --- a/core/modules/simpletest/simpletest.module +++ b/core/modules/simpletest/simpletest.module @@ -84,10 +84,12 @@ function simpletest_theme() { 'simpletest_test_table' => array( 'render element' => 'table', 'file' => 'simpletest.pages.inc', + 'template' => 'simpletest-test-table', ), 'simpletest_result_summary' => array( - 'render element' => 'form', + 'variables' => array('form' => NULL), 'file' => 'simpletest.pages.inc', + 'template' => 'simpletest-result-summary', ), ); } diff --git a/core/modules/simpletest/simpletest.pages.inc b/core/modules/simpletest/simpletest.pages.inc index 7fe64d7..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 theme_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 theme_simpletest_test_table($variables) { // Add js array of settings. drupal_add_js(array('simpleTest' => $js), 'setting'); - if (empty($rows)) { - return '' . t('No tests to display.') . ''; - } - else { - return 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,9 +372,11 @@ function simpletest_result_form_submit($form, &$form_state) { * * @ingroup themeable */ -function theme_simpletest_result_summary($variables) { +function template_preprocess_simpletest_result_summary(&$variables) { $form = $variables['form']; - return '
' . _simpletest_format_summary_line($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 new file mode 100644 index 0000000..248595b --- /dev/null +++ b/core/modules/simpletest/templates/simpletest-result-summary.html.twig @@ -0,0 +1,16 @@ +{# +/** + * @file + * Default theme implementation for the content of simpletest result summary. + * + * Available variables: + * - status: Pass or fail of test. + * - summary: Summary info of test. + * + * @see template_preprocess() + * @see template_preprocess_simpletest_result_summary() + * + * @ingroup themeable + */ +#} +