From 582fbf2828dd0b359fe04e6ac22ca3b9a6927a11 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 8 Mar 2009 21:52:10 +0000 Subject: - Patch #395228 by c960657: fixed sorting order in drupalGetTestFiles(). --- modules/simpletest/drupal_web_test_case.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'modules/simpletest/drupal_web_test_case.php') diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php index d4d14093f..3869a8e7f 100644 --- a/modules/simpletest/drupal_web_test_case.php +++ b/modules/simpletest/drupal_web_test_case.php @@ -608,15 +608,14 @@ class DrupalWebTestCase { * Compare two files based on size and file name. */ protected function drupalCompareFiles($file1, $file2) { - // Determine which file is larger. - $compare_size = (filesize($file1->filepath) > filesize($file2->filepath)); - if (!$compare_size) { - // Both files were the same size, so return whichever one is alphabetically greater. - return strnatcmp($file1->name, $file2->name); + $compare_size = filesize($file1->filepath) - filesize($file2->filepath); + if ($compare_size) { + // Sort by file size. + return $compare_size; } else { - // Return TRUE if $file1 is larger than $file2. - return $compare_size; + // The files were the same size, so sort alphabetically. + return strnatcmp($file1->name, $file2->name); } } -- cgit v1.2.3