diff options
-rw-r--r-- | modules/simpletest/simpletest.pages.inc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/simpletest/simpletest.pages.inc b/modules/simpletest/simpletest.pages.inc index 2df1765fa..34b111862 100644 --- a/modules/simpletest/simpletest.pages.inc +++ b/modules/simpletest/simpletest.pages.inc @@ -121,6 +121,9 @@ function theme_simpletest_test_table($table) { 'clickActive' => FALSE, ); + // Sorting $element by children's #title attribute instead of by class name. + uasort($element, '_simpletest_sort_by_title'); + // Cycle through each test within the current group. foreach (element_children($element) as $test_name) { $test = $element[$test_name]; @@ -160,6 +163,18 @@ function theme_simpletest_test_table($table) { } /** + * Sort element by title instead of by class name. + */ +function _simpletest_sort_by_title($a, $b) { + // This is for parts of $element that are not an array. + if (!isset($a['#title']) || !isset($b['#title'])) { + return 1; + } + + return strcasecmp($a['#title'], $b['#title']); +} + +/** * Run selected tests. */ function simpletest_test_form_submit($form, &$form_state) { |