From 6a079ec2778e7b00cd15f54adf120b8e6c34004d Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sat, 20 Jun 2009 06:09:56 +0000 Subject: #496950 by oestrich: Alphabetize the list of tests. --- modules/simpletest/simpletest.pages.inc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'modules/simpletest') 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]; @@ -159,6 +162,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. */ -- cgit v1.2.3