summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-06-20 06:09:56 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-06-20 06:09:56 +0000
commit6a079ec2778e7b00cd15f54adf120b8e6c34004d (patch)
treec215ab0b7eea8077d353fa9305519d82b00f4728
parentfbca3630109ebae5dfc12d46b4267242539039ed (diff)
downloadbrdo-6a079ec2778e7b00cd15f54adf120b8e6c34004d.tar.gz
brdo-6a079ec2778e7b00cd15f54adf120b8e6c34004d.tar.bz2
#496950 by oestrich: Alphabetize the list of tests.
-rw-r--r--modules/simpletest/simpletest.pages.inc15
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) {