? patches
Index: drupal_web_test_case.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/Attic/drupal_web_test_case.php,v
retrieving revision 1.2.2.3.2.52
diff -u -p -r1.2.2.3.2.52 drupal_web_test_case.php
--- drupal_web_test_case.php	12 Nov 2010 22:52:36 -0000	1.2.2.3.2.52
+++ drupal_web_test_case.php	12 Nov 2010 23:46:51 -0000
@@ -1,16 +1,5 @@
 <?php
 // $Id: drupal_web_test_case.php,v 1.2.2.3.2.52 2010/11/12 22:52:36 davereid Exp $
-// Core: Id: drupal_web_test_case.php,v 1.146 2009/08/31 18:30:26 webchick Exp $
-
-/**
- * @file
- * Provide required modifications to Drupal 7 core DrupalWebTestCase in order
- * for it to function properly in Drupal 6.
- *
- * Copyright 2008-2009 by Jimmy Berry ("boombatower", http://drupal.org/user/214218)
- */
-
-module_load_include('function.inc', 'simpletest');
 
 /**
  * Base class for Drupal tests.
@@ -42,7 +31,7 @@ abstract class DrupalTestCase {
   /**
    * Time limit for the test.
    */
-  protected $timeLimit = 180;
+  protected $timeLimit = 240;
 
   /**
    * Current results of this test case.
@@ -162,7 +151,11 @@ abstract class DrupalTestCase {
    * the method behaves just like DrupalTestCase::assert() in terms of storing
    * the assertion.
    *
+   * @return
+   *   Message ID of the stored assertion.
+   *
    * @see DrupalTestCase::assert()
+   * @see DrupalTestCase::deleteAssert()
    */
   public static function insertAssert($test_id, $test_class, $status, $message = '', $group = 'Other', array $caller = array()) {
     // Convert boolean status to string status.
@@ -187,12 +180,26 @@ abstract class DrupalTestCase {
       'file' => $caller['file'],
     );
 
-//    db_insert('simpletest')
-//      ->fields($assertion)
-//      ->execute();
     db_query("INSERT INTO {simpletest}
               (test_id, test_class, status, message, message_group, function, line, file)
               VALUES (%d, '%s', '%s', '%s', '%s', '%s', %d, '%s')", array_values($assertion));
+    $message_id = db_last_insert_id('simpletest', 'message_id');
+    return $message_id;
+  }
+
+  /**
+   * Delete an assertion record by message ID.
+   *
+   * @param $message_id
+   *   Message ID of the assertion to delete.
+   * @return
+   *   TRUE if the assertion was deleted, FALSE otherwise.
+   *
+   * @see DrupalTestCase::insertAssert()
+   */
+  public static function deleteAssert($message_id) {
+    db_query("DELETE FROM {simpletest} WHERE message_id = %d", $message_id);
+    return (bool) db_affected_rows();
   }
 
   /**
@@ -412,18 +419,28 @@ abstract class DrupalTestCase {
 
     // HTTP auth settings (<username>:<password>) for the simpletest browser
     // when sending requests to the test site.
-    $username = variable_get('simpletest_username', NULL);
-    $password = variable_get('simpletest_password', NULL);
+    $this->httpauth_method = variable_get('simpletest_httpauth_method', CURLAUTH_BASIC);
+    $username = variable_get('simpletest_httpauth_username', NULL);
+    $password = variable_get('simpletest_httpauth_password', NULL);
     if ($username && $password) {
       $this->httpauth_credentials = $username . ':' . $password;
     }
 
     set_error_handler(array($this, 'errorHandler'));
-    $methods = array();
+    $class = get_class($this);
     // Iterate through all the methods in this class.
-    foreach (get_class_methods(get_class($this)) as $method) {
+    foreach (get_class_methods($class) as $method) {
       // If the current method starts with "test", run it - it's a test.
       if (strtolower(substr($method, 0, 4)) == 'test') {
+        // Insert a fail record. This will be deleted on completion to ensure
+        // that testing completed.
+        $method_info = new ReflectionMethod($class, $method);
+        $caller = array(
+          'file' => $method_info->getFileName(),
+          'line' => $method_info->getStartLine(),
+          'function' => $class . '->' . $method . '()',
+        );
+        $completion_check_id = DrupalTestCase::insertAssert($this->testId, $class, FALSE, t('The test did not complete due to a fatal error.'), 'Completion check', $caller);
         $this->setUp();
         try {
           $this->$method();
@@ -433,6 +450,8 @@ abstract class DrupalTestCase {
           $this->exceptionHandler($e);
         }
         $this->tearDown();
+        // Remove the completion check record.
+        DrupalTestCase::deleteAssert($completion_check_id);
       }
     }
     // Clear out the error messages and restore error handler.
@@ -535,8 +554,7 @@ abstract class DrupalTestCase {
  *
  * These tests can not access the database nor files. Calling any Drupal
  * function that needs the database will throw exceptions. These include
- * watchdog(), function_exists(), module_implements(),
- * module_invoke_all() etc.
+ * watchdog(), module_implements(), module_invoke_all() etc.
  */
 class DrupalUnitTestCase extends DrupalTestCase {
 
@@ -662,6 +680,11 @@ class DrupalWebTestCase extends DrupalTe
   protected $originalUser = NULL;
 
   /**
+   * HTTP authentication method
+   */
+  protected $httpauth_method = CURLAUTH_BASIC;
+
+  /**
    * HTTP authentication credentials (<username>:<password>).
    */
   protected $httpauth_credentials = NULL;
@@ -1297,6 +1320,7 @@ class DrupalWebTestCase extends DrupalTe
         CURLOPT_HEADERFUNCTION => array(&$this, 'curlHeaderCallback'),
       );
       if (isset($this->httpauth_credentials)) {
+        $curl_options[CURLOPT_HTTPAUTH] = $this->httpauth_method;
         $curl_options[CURLOPT_USERPWD] = $this->httpauth_credentials;
       }
       curl_setopt_array($this->curlHandle, $this->additionalCurlOptions + $curl_options);
@@ -2666,7 +2690,7 @@ function simpletest_verbose($message, $o
   if ($original_file_directory) {
     $file_directory = $original_file_directory;
     $class = $test_class;
-    $verbose = variable_get('simpletest_verbose', FALSE);
+    $verbose = variable_get('simpletest_verbose', TRUE);
     $directory = $file_directory . '/simpletest/verbose';
 //    return file_prepare_directory($directory, FILE_CREATE_DIRECTORY);
     return file_check_directory($directory, FILE_CREATE_DIRECTORY);
Index: simpletest.css
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/Attic/simpletest.css,v
retrieving revision 1.1.6.4
diff -u -p -r1.1.6.4 simpletest.css
--- simpletest.css	5 Sep 2009 13:34:10 -0000	1.1.6.4
+++ simpletest.css	12 Nov 2010 23:46:51 -0000
@@ -1,5 +1,4 @@
 /* $Id: simpletest.css,v 1.1.6.4 2009/09/05 13:34:10 boombatower Exp $
-/* Core: Id: simpletest.css,v 1.6 2009/08/04 06:47:00 webchick Exp */
 
 /* Addon for the simpletest module */
 #simpletest {
@@ -72,3 +71,22 @@ div.simpletest-image {
   display: inline;
   cursor: pointer;
 }
+
+a.simpletest-collapse {
+  height: 0;
+  width: 0;
+  top: -99em;
+  position: absolute;
+
+}
+
+a.simpletest-collapse:focus,
+a.simpletest-collapse:hover {
+  font-size: 80%;
+  top: 0px;
+  height: auto;
+  width: auto;
+  overflow: visible;
+  position: relative;
+  z-index: 1000;
+}
Index: simpletest.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/Attic/simpletest.install,v
retrieving revision 1.4.2.3.2.23
diff -u -p -r1.4.2.3.2.23 simpletest.install
--- simpletest.install	7 Oct 2010 22:16:59 -0000	1.4.2.3.2.23
+++ simpletest.install	12 Nov 2010 23:46:51 -0000
@@ -4,16 +4,16 @@
 
 /**
  * @file
- * Backport of Drupal 7 simpletest.install with modifications, see BACKPORT.txt.
- *
- * Copyright 2008-2009 by Jimmy Berry ("boombatower", http://drupal.org/user/214218)
+ * Install, update and uninstall functions for the simpletest module.
  */
 
 /**
- * Implementation of hook_install().
+ * Implements hook_install().
  */
 function simpletest_install() {
+  // Install schema.
   drupal_install_schema('simpletest');
+
   // Check for files directory.
 //  $path = 'public://simpletest';
 //  if (file_prepare_directory($path, FILE_CREATE_DIRECTORY)) {
@@ -107,14 +107,15 @@ function simpletest_get_file_count($dire
 }
 
 /**
- * Implementation of hook_uninstall().
+ * Implements hook_uninstall().
  */
 function simpletest_uninstall() {
   simpletest_clean_environment();
 
   // Remove settings variables.
-  variable_del('simpletest_username');
-  variable_del('simpletest_password');
+  variable_del('simpletest_httpauth_method');
+  variable_del('simpletest_httpauth_username');
+  variable_del('simpletest_httpauth_password');
   variable_del('simpletest_clear_results');
   variable_del('simpletest_verbose');
 
@@ -142,6 +143,8 @@ function simpletest_requirements($phase)
   $has_curl = function_exists('curl_init');
   $has_hash = function_exists('hash_hmac');
   $has_domdocument = method_exists('DOMDocument', 'loadHTML');
+  $open_basedir = ini_get('open_basedir');
+  $patch_installed = isset($GLOBALS['simpletest_installed']);
 
   $requirements['curl'] = array(
     'title' => $t('cURL'),
@@ -166,33 +169,38 @@ function simpletest_requirements($phase)
   );
   if (!$has_domdocument) {
     $requirements['php_domdocument']['severity'] = REQUIREMENT_ERROR;
-    $requirements['php_domdocument']['description'] =t('SimpleTest requires the DOMDocument class to be available. Please check the configure command at the <a href="@link-phpinfo">PHP info page</a>.', array('@link-phpinfo' => url('admin/reports/status/php')));
+    $requirements['php_domdocument']['description'] = $t('SimpleTest requires the DOMDocument class to be available. Check the configure command at the <a href="@link-phpinfo">PHP info page</a>.', array('@link-phpinfo' => url('admin/reports/status/php')));
+  }
+
+  // SimpleTest currently needs 2 cURL options which are incompatible with
+  // having PHP's open_basedir restriction set.
+  // See http://drupal.org/node/674304.
+  $requirements['php_open_basedir'] = array(
+    'title' => $t('PHP open_basedir restriction'),
+    'value' => $open_basedir ? $t('Enabled') : $t('Disabled'),
+  );
+  if ($open_basedir) {
+    $requirements['php_open_basedir']['severity'] = REQUIREMENT_ERROR;
+    $requirements['php_open_basedir']['description'] = $t('The testing framework requires the PHP <a href="@open_basedir-url">open_basedir</a> restriction to be disabled. Check your webserver configuration or contact your web host.', array('@open_basedir-url' => 'http://php.net/manual/en/ini.core.php#ini.open-basedir'));
   }
 
-  // Drupal 6.
-  // Check that the global variable is defined signifying that the code was inserted correctly.
-  if (isset($GLOBALS['simpletest_installed'])) {
-     $requirements['simpletest_settings'] = array(
-      'title' => $t('SimpleTest code addition'),
-      'value' => t('Found'),
-      'severity' => REQUIREMENT_OK
-    );
-  }
-  else {
-    $requirements['simpletest_settings'] = array(
-      'title' => $t('SimpleTest code addition'),
-      'value' => t('Not-found'),
-      'severity' => REQUIREMENT_ERROR,
-      'description' => $t('SimpleTest could not be installed. Must apply core patch, please see
-                           <a href="@install">INSTALL.txt</a>.',
-                           array('%settings' => realpath(conf_path() . '/settings.php'),
-                                 '@install' => base_path() . drupal_get_path('module', 'simpletest') . '/INSTALL.txt')),
-    );
+  // Check that the global variable is defined signifying that the patch
+  // was correctly applied to the Drupal 6 core.
+  $requirements['simpletest_patch'] = array(
+    'title' => $t('SimpleTest code addition'),
+    'value' => $patch_installed ? $t('Found') : $t('Not found'),
+  );
+  if (!$patch_installed) {
+    $requirements['simpletest_patch']['severity'] = REQUIREMENT_ERROR;
+    $requirements['simpletest_patch']['description'] = $t('SimpleTest could not be installed. The required core patch must be applied. See the included <a href="@install">INSTALL.txt</a>.', array('@install' => base_path() . drupal_get_path('module', 'simpletest') . '/INSTALL.txt'));
   }
 
   return $requirements;
 }
 
+/**
+ * Implements hook_schema().
+ */
 function simpletest_schema() {
   $schema['simpletest'] = array(
     'description' => 'Stores simpletest messages',
@@ -306,3 +314,16 @@ function simpletest_update_6200() {
 
   return $ret;
 }
+
+/**
+ * Renamed authentication username and password variables.
+ */
+function simpletest_update_6201() {
+  $username = variable_get('simpletest_username', '');
+  $password = variable_get('simpletest_password', '');
+  variable_set('simpletest_httpauth_username', $username);
+  variable_set('simpletest_httpauth_password', $password);
+  variable_del('simpletest_username', '');
+  variable_del('simpletest_password', '');
+  return array();
+}
Index: simpletest.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/Attic/simpletest.js,v
retrieving revision 1.2.4.6
diff -u -p -r1.2.4.6 simpletest.js
--- simpletest.js	14 Dec 2009 23:29:36 -0000	1.2.4.6
+++ simpletest.js	12 Nov 2010 23:46:51 -0000
@@ -1,26 +1,19 @@
 // $Id: simpletest.js,v 1.2.4.6 2009/12/14 23:29:36 boombatower Exp $
-// Core: Id: simpletest.js,v 1.11 2009/04/27 20:19:37 webchick Exp
-//(function ($) {
+(function ($) {
 
 /**
  * Add the cool table collapsing on the testing overview page.
  */
-//Drupal.behaviors.simpleTestMenuCollapse = {
-//  attach: function (context, settings) {
 Drupal.behaviors.simpleTestMenuCollapse = function() {
     var timeout = null;
     // Adds expand-collapse functionality.
     $('div.simpletest-image:not(.simpletest-image-processed)').addClass('simpletest-image-processed').each(function () {
-//      direction = settings.simpleTest[$(this).attr('id')].imageDirection;
-//      $(this).html(settings.simpleTest.images[direction]);
       direction = Drupal.settings.simpleTest[$(this).attr('id')].imageDirection;
       $(this).html(Drupal.settings.simpleTest.images[direction]);
     });
 
     // Adds group toggling functionality to arrow images.
     $('div.simpletest-image:not(.simpletest-click-processed)').addClass('simpletest-click-processed').click(function () {
-//      var trs = $(this).parents('tbody').children('.' + settings.simpleTest[this.id].testClass);
-//      var direction = settings.simpleTest[this.id].imageDirection;
       var trs = $(this).parents('tbody').children('.' + Drupal.settings.simpleTest[this.id].testClass);
       var direction = Drupal.settings.simpleTest[this.id].imageDirection;
       var row = direction ? trs.size() - 1 : 0;
@@ -54,24 +47,18 @@ Drupal.behaviors.simpleTestMenuCollapse 
       rowToggle();
 
       // Toggle the arrow image next to the test group title.
-//      $(this).html(settings.simpleTest.images[(direction ? 0 : 1)]);
-//      settings.simpleTest[this.id].imageDirection = !direction;
       $(this).html(Drupal.settings.simpleTest.images[(direction ? 0 : 1)]);
       Drupal.settings.simpleTest[this.id].imageDirection = !direction;
 
     });
-//  }
 };
 
 /**
  * Select/deselect all the inner checkboxes when the outer checkboxes are
  * selected/deselected.
  */
-//Drupal.behaviors.simpleTestSelectAll = {
-//  attach: function (context, settings) {
 Drupal.behaviors.simpleTestSelectAll = function() {
     $('td.simpletest-select-all:not(.simpletest-select-processed)').addClass('simpletest-select-processed').each(function () {
-//      var testCheckboxes = settings.simpleTest['simpletest-test-group-' + $(this).attr('id')].testNames;
       var testCheckboxes = Drupal.settings.simpleTest['simpletest-test-group-' + $(this).attr('id')].testNames;
       var groupCheckbox = $('<input type="checkbox" class="form-checkbox" id="' + $(this).attr('id') + '-select-all" />');
 
@@ -108,7 +95,6 @@ Drupal.behaviors.simpleTestSelectAll = f
       updateGroupCheckbox();
       $(this).append(groupCheckbox);
     });
-//  }
 };
 
-//})(jQuery);
+})(jQuery);
Index: simpletest.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/Attic/simpletest.module,v
retrieving revision 1.33.2.4.2.24
diff -u -p -r1.33.2.4.2.24 simpletest.module
--- simpletest.module	12 Nov 2010 20:59:46 -0000	1.33.2.4.2.24
+++ simpletest.module	12 Nov 2010 23:46:51 -0000
@@ -4,32 +4,32 @@
 
 /**
  * @file
- * Backport of Drupal 7 simpletest.module with modifications, see BACKPORT.txt.
- *
- * Copyright 2008-2009 by Jimmy Berry ("boombatower", http://drupal.org/user/214218)
+ * Provides testing functionality.
  */
 
 /**
- * Implementation of hook_help().
+ * Implements hook_help().
  */
 function simpletest_help($path, $arg) {
   switch ($path) {
     case 'admin/help#simpletest':
-      $output  = '<p>' . t('The SimpleTest module is a framework for running automated unit tests in Drupal. It can be used to verify a working state of Drupal before and after any code changes, or as a means for developers to write and execute tests for their modules.') . '</p>';
-//      $output .= '<p>' . t('Visit <a href="@admin-simpletest">Administer >> Structure >> SimpleTest</a> to display a list of available tests. For comprehensive testing, select <em>all</em> tests, or individually select tests for more targeted testing. Note that it might take several minutes for all tests to complete.)', array('@admin-simpletest' => url('admin/config/development/testing'))) . '</p>';
-      $output .= '<p>' . t('Visit <a href="@admin-simpletest">Administer >> Structure >> SimpleTest</a> to display a list of available tests. For comprehensive testing, select <em>all</em> tests, or individually select tests for more targeted testing. Note that it might take several minutes for all tests to complete.)', array('@admin-simpletest' => url('admin/build/testing'))) . '</p>';
-      $output .= '<p>' . t('After the tests have run, a message will be displayed next to each test group indicating whether tests within it passed, failed, or had exceptions. A pass means that a test returned the expected results, while fail means that it did not. An exception normally indicates an error outside of the test, such as a PHP warning or notice. If there were fails or exceptions, the results are expanded, and the tests that had issues will be indicated in red or pink rows. Use these results to refine your code and tests until all tests return a pass.') . '</p>';
-      $output .= '<p>' . t('For more information on creating and modifying your own tests, see the <a href="@simpletest-api">SimpleTest API Documentation</a> in the Drupal handbook.', array('@simpletest-api' => 'http://drupal.org/simpletest')) . '</p>';
-      $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@simpletest">SimpleTest module</a>.', array('@simpletest' => 'http://drupal.org/handbook/modules/simpletest')) . '</p>';
+      $output = '';
+      $output .= '<h3>' . t('About') . '</h3>';
+      $output .= '<p>' . t('The SimpleTest module provides a framework for running automated unit tests. It can be used to verify a working state of Drupal before and after any code changes, or as a means for developers to write and execute tests for their modules. For more information, see the online handbook entry for <a href="@simpletest">SimpleTest module</a>.', array('@simpletest' => 'http://drupal.org/handbook/modules/simpletest', '@blocks' => url('admin/build/block'))) . '</p>';
+      $output .= '<h3>' . t('Uses') . '</h3>';
+      $output .= '<dl>';
+      $output .= '<dt>' . t('Running tests') . '</dt>';
+      $output .= '<dd>' . t('Visit the <a href="@admin-simpletest">Testing page</a> to display a list of available tests. For comprehensive testing, select <em>all</em> tests, or individually select tests for more targeted testing. Note that it might take several minutes for all tests to complete. For more information on creating and modifying your own tests, see the <a href="@simpletest-api">Testing API Documentation</a> in the Drupal handbook.', array('@simpletest-api' => 'http://drupal.org/simpletest', '@admin-simpletest' => url('admin/build/testing'))) . '</dd>';
+      $output .= '<dd>' . t('After the tests run, a message will be displayed next to each test group indicating whether tests within it passed, failed, or had exceptions. A pass means that the test returned the expected results, while fail means that it did not. An exception normally indicates an error outside of the test, such as a PHP warning or notice. If there were failures or exceptions, the results will be expanded to show details, and the tests that had failures or exceptions will be indicated in red or pink rows. You can then use these results to refine your code and tests, until all tests pass.') . '</dd>';
+      $output .= '</dl>';
       return $output;
   }
 }
 
 /**
- * Implementation of hook_menu().
+ * Implements hook_menu().
  */
 function simpletest_menu() {
-//  $items['admin/config/development/testing'] = array(
   $items['admin/build/testing'] = array(
     'title' => 'Testing',
     'page callback' => 'drupal_get_form',
@@ -38,12 +38,10 @@ function simpletest_menu() {
     'access arguments' => array('administer unit tests'),
     'file' => 'simpletest.pages.inc',
   );
-//  $items['admin/config/development/testing/list'] = array(
   $items['admin/build/testing/list'] = array(
     'title' => 'List',
     'type' => MENU_DEFAULT_LOCAL_TASK,
   );
-//  $items['admin/config/development/testing/settings'] = array(
   $items['admin/build/testing/settings'] = array(
     'title' => 'Settings',
     'page callback' => 'drupal_get_form',
@@ -52,11 +50,9 @@ function simpletest_menu() {
     'type' => MENU_LOCAL_TASK,
     'file' => 'simpletest.pages.inc',
   );
-//  $items['admin/config/development/testing/results/%'] = array(
   $items['admin/build/testing/results/%'] = array(
     'title' => 'Test result',
     'page callback' => 'drupal_get_form',
-//    'page arguments' => array('simpletest_result_form', 5),
     'page arguments' => array('simpletest_result_form', 4),
     'description' => 'View result of tests.',
     'access arguments' => array('administer unit tests'),
@@ -67,20 +63,20 @@ function simpletest_menu() {
 }
 
 /**
- * Implementation of hook_perm().
+ * Implements hook_permission().
  */
 function simpletest_perm() {
-//  return array(
-//    'administer unit tests' => array(
-//      'title' => t('Administer unit tests'),
-//      'description' => t('Manage and run automated testing. %warning', array('%warning' => t('Warning: Give to trusted roles only; this permission has security implications.'))),
-//    ),
-//  );
-  return array('administer unit tests');
+  $permissions = array(
+    'administer unit tests' => array(
+      'title' => t('Administer tests'),
+      'restrict access' => TRUE,
+    ),
+  );
+  return array_keys($permissions);
 }
 
 /**
- * Implementation of hook_theme().
+ * Implements hook_theme().
  */
 function simpletest_theme() {
   return array(
@@ -95,31 +91,6 @@ function simpletest_theme() {
   );
 }
 
-///**
-// * Implementation of hook_stream_wrappers().
-// */
-//function simpletest_test_stream_wrappers() {
-//  return array(
-//    'simpletest' => array(
-//      'name' => t('Simpletest files'),
-//      'class' => 'DrupalSimpleTestStreamWrapper',
-//      'description' => t('Stream Wrapper for Simpletest files.'),
-//    ),
-//  );
-//}
-
-///**
-// * Implement hook_js_alter().
-// */
-//function simpletest_js_alter(&$javascript) {
-//  // Since SimpleTest is a special use case for the table select, stick the
-//  // SimpleTest JavaScript above the table select.
-//  $simpletest = drupal_get_path('module', 'simpletest') . '/simpletest.js';
-//  if (array_key_exists($simpletest, $javascript) && array_key_exists('misc/tableselect.js', $javascript)) {
-//    $javascript[$simpletest]['weight'] = $javascript['misc/tableselect.js']['weight'] - 1;
-//  }
-//}
-
 function _simpletest_format_summary_line($summary) {
   $args = array(
     '@pass' => format_plural(isset($summary['#pass']) ? $summary['#pass'] : 0, '1 pass', '@count passes'),
@@ -161,7 +132,7 @@ function simpletest_run_tests($test_list
   $info = $first_instance->getInfo();
 
   $batch = array(
-    'title' => t('Running SimpleTests'),
+    'title' => t('Running tests'),
     'operations' => array(
       array('_simpletest_batch_operation', array($test_list, $test_id)),
     ),
@@ -180,8 +151,8 @@ function simpletest_run_tests($test_list
   // By calling batch_process() directly, we skip that behavior and ensure
   // that we don't exceed the size of data that can be sent to the database
   // (max_allowed_packet on MySQL).
-//  batch_process('admin/config/development/testing/results/' . $test_id);
   batch_process('admin/build/testing/results/' . $test_id);
+  return $test_id;
 }
 
 /**
@@ -246,10 +217,8 @@ function _simpletest_batch_operation($te
   $context['finished'] = 1 - $size / $max;
 }
 
-//function _simpletest_batch_finished($success, $results, $operations, $elapsed) {
 function _simpletest_batch_finished($success, $results, $operations) {
   if ($success) {
-//    drupal_set_message(t('The test run finished in @elapsed.', array('@elapsed' => $elapsed)));
     drupal_set_message(t('The test run finished.'));
   }
   else {
@@ -263,7 +232,7 @@ function _simpletest_batch_finished($suc
     simpletest_log_read($test_id, $last_prefix, $last_test_class);
 
     drupal_set_message(t('The test run did not successfully finish.'), 'error');
-    drupal_set_message(t('Please use the <em>Clean environment</em> button to clean-up temporary files and tables.'), 'warning');
+    drupal_set_message(t('Use the <em>Clean environment</em> button to clean-up temporary files and tables.'), 'warning');
   }
   module_invoke_all('test_group_finished');
 }
@@ -278,10 +247,8 @@ function _simpletest_batch_finished($suc
  *   that ran.
  */
 function simpletest_last_test_get($test_id) {
-//  $last_prefix = db_result(db_query_range('SELECT last_prefix FROM {simpletest_test_id} WHERE test_id = :test_id', array(':test_id' => $test_id), 0, 1));
-  $last_prefix = db_result(db_query_range('SELECT last_prefix FROM {simpletest_test_id} WHERE test_id = ' . $test_id, 0, 1));
-//  $last_test_class = db_result(db_query_range('SELECT test_class FROM {simpletest} WHERE test_id = :test_id ORDER BY message_id DESC', array(':test_id' => $test_id), 0, 1));
-  $last_test_class = db_result(db_query_range('SELECT test_class FROM {simpletest} WHERE test_id = ' . $test_id . ' ORDER BY message_id DESC', 0, 1));
+  $last_prefix = db_result(db_query_range('SELECT last_prefix FROM {simpletest_test_id} WHERE test_id = %d', array(':test_id' => $test_id), 0, 1));
+  $last_test_class = db_result(db_query_range('SELECT test_class FROM {simpletest} WHERE test_id = %d ORDER BY message_id DESC', array(':test_id' => $test_id), 0, 1));
   return array($last_prefix, $last_test_class);
 }
 
@@ -305,7 +272,6 @@ function simpletest_last_test_get($test_
  */
 function simpletest_log_read($test_id, $prefix, $test_class, $during_test = FALSE) {
   require_once drupal_get_path('module', 'simpletest') . '/drupal_web_test_case.php';
-//  $log = 'public://' . ($during_test ? '' : '/simpletest/' . substr($prefix, 10)) . '/error.log';
   $log = file_directory_path() . ($during_test ? '' : '/simpletest/' . substr($prefix, 10)) . '/error.log';
   $found = FALSE;
   if (file_exists($log)) {
@@ -586,25 +552,15 @@ function simpletest_clean_temporary_dire
 function simpletest_clean_results_table($test_id = NULL) {
   if (variable_get('simpletest_clear_results', TRUE)) {
     if ($test_id) {
-//      $count = db_query('SELECT COUNT(test_id) FROM {simpletest_test_id} WHERE test_id = :test_id', array(':test_id' => $test_id))->fetchField();
       $count = db_result(db_query('SELECT COUNT(test_id) FROM {simpletest_test_id} WHERE test_id = %d', $test_id));
 
-//      db_delete('simpletest')
-//        ->condition('test_id', $test_id)
-//        ->execute();
-//      db_delete('simpletest_test_id')
-//        ->condition('test_id', $test_id)
-//        ->execute();
       db_query("DELETE FROM {simpletest} WHERE test_id = %d", $test_id);
       db_query("DELETE FROM {simpletest_test_id} WHERE test_id = %d", $test_id);
     }
     else {
-//      $count = db_query('SELECT COUNT(test_id) FROM {simpletest_test_id}')->fetchField();
       $count = db_result(db_query('SELECT COUNT(test_id) FROM {simpletest_test_id}'));
 
       // Clear test results.
-//      db_delete('simpletest')->execute();
-//      db_delete('simpletest_test_id')->execute();
       db_query('DELETE FROM {simpletest}');
       db_query('DELETE FROM {simpletest_test_id}');
     }
Index: simpletest.pages.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/Attic/simpletest.pages.inc,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 simpletest.pages.inc
--- simpletest.pages.inc	14 Sep 2009 22:37:35 -0000	1.1.2.2
+++ simpletest.pages.inc	12 Nov 2010 23:46:51 -0000
@@ -9,9 +9,7 @@
 /**
  * List tests arranged in groups that can be selected and run.
  */
-function simpletest_test_form() {
-  $form = array();
-
+function simpletest_test_form(&$form_state) {
   $form['tests'] = array(
     '#type' => 'fieldset',
     '#title' => t('Tests'),
@@ -38,32 +36,34 @@ function simpletest_test_form() {
     }
   }
 
- // Operation buttons.
- $form['tests']['op'] = array(
-   '#type' => 'submit',
-   '#value' => t('Run tests'),
- );
- $form['clean'] = array(
-   '#type' => 'fieldset',
-   '#collapsible' => FALSE,
-   '#collapsed' => FALSE,
-   '#title' => t('Clean test environment'),
-   '#description' => t('Remove tables with the prefix "simpletest" and temporary directories that are left over from tests that crashed. This is intended for developers when creating tests.'),
- );
- $form['clean']['op'] = array(
-   '#type' => 'submit',
-   '#value' => t('Clean environment'),
-   '#submit' => array('simpletest_clean_environment'),
- );
+  // Operation buttons.
+  $form['tests']['op'] = array(
+    '#type' => 'submit',
+    '#value' => t('Run tests'),
+  );
+  $form['clean'] = array(
+    '#type' => 'fieldset',
+    '#collapsible' => FALSE,
+    '#collapsed' => FALSE,
+    '#title' => t('Clean test environment'),
+    '#description' => t('Remove tables with the prefix "simpletest" and temporary directories that are left over from tests that crashed. This is intended for developers when creating tests.'),
+  );
+  $form['clean']['op'] = array(
+    '#type' => 'submit',
+    '#value' => t('Clean environment'),
+    '#submit' => array('simpletest_clean_environment'),
+  );
 
   return $form;
 }
 
 /**
- * Theme the test list generated by simpletest_test_form() into a table.
+ * Returns HTML for a test list generated by simpletest_test_form() into a table.
  *
  * @param $table Form array that represent a table.
  * @return HTML output.
+ *
+ * @ingroup themeable
  */
 function theme_simpletest_test_table($table) {
   drupal_add_css(drupal_get_path('module', 'simpletest') . '/simpletest.css');
@@ -82,7 +82,7 @@ function theme_simpletest_test_table($ta
   $js = array(
     'images' => array(
       theme('image', 'misc/menu-collapsed.png', 'Expand', 'Expand'),
-      theme('image', 'misc/menu-expanded.png', 'Collapsed', 'Collapsed'),
+      theme('image', 'misc/menu-expanded.png', 'Collapsed', 'Collapse'),
     ),
   );
 
@@ -102,7 +102,6 @@ function theme_simpletest_test_table($ta
     $image_index = $collapsed ? 0 : 1;
 
     // Place-holder for checkboxes to select group of tests.
-//     $row[] = array('id' => $test_class, 'class' => array('simpletest-select-all'));
     $row[] = array('id' => $test_class, 'class' => 'simpletest-select-all');
 
     // Expand/collapse image and group title.
@@ -114,7 +113,6 @@ function theme_simpletest_test_table($ta
 
     $row[] = '&nbsp;';
 
-//    $rows[] = array('data' => $row, 'class' => array('simpletest-group'));
     $rows[] = array('data' => $row, 'class' => 'simpletest-group');
 
     // Add individual tests to group.
@@ -149,7 +147,6 @@ function theme_simpletest_test_table($ta
       $row[] = theme('indentation', 1) . '<label for="edit-' . $test_name . '">' . $title . '</label>';
       $row[] = '<div class="description">' . $description . '</div>';
 
-//      $rows[] = array('data' => $row, 'class' => array($test_class . '-test', ($collapsed ? 'js-hide' : '')));
       $rows[] = array('data' => $row, 'class' => $test_class . '-test ' . ($collapsed ? 'js-hide' : ''));
     }
     $js['simpletest-test-group-' . $test_class] = $current_js;
@@ -185,19 +182,22 @@ function _simpletest_sort_by_title($a, $
 function simpletest_test_form_submit($form, &$form_state) {
   // Get list of tests.
   $tests_list = array();
-  $classes = simpletest_test_get_all_classes(); // Drupal 6.
+  $classes = simpletest_test_get_all_classes();
   foreach ($form_state['values'] as $class_name => $value) {
-    // Drupal 6.
     if (isset($classes[$class_name]['file'])) {
       require_once $classes[$class_name]['file'];
     }
 
-    if (class_exists($class_name) && $value === 1) {
+    // Since class_exists() will likely trigger an autoload lookup,
+    // we do the fast check first.
+    if ($value === 1 && class_exists($class_name)) {
       $tests_list[] = $class_name;
     }
   }
-  if (count($tests_list) > 0 ) {
-    simpletest_run_tests($tests_list, 'drupal');
+  if (count($tests_list) > 0) {
+    $test_id = simpletest_run_tests($tests_list, 'drupal');
+    dpm($test_id);
+    $form_state['redirect'] = 'admin/build/testing/results/' . $test_id;
   }
   else {
     drupal_set_message(t('No test(s) selected.'), 'error');
@@ -214,7 +214,6 @@ function simpletest_result_form(&$form_s
   $results = array();
   if (is_numeric($test_id) && !$results = simpletest_result_get($test_id)) {
     drupal_set_message(t('No test results to display.'), 'error');
-//    drupal_goto('admin/config/development/testing');
     drupal_goto('admin/build/testing');
     return $form;
   }
@@ -242,12 +241,12 @@ function simpletest_result_form(&$form_s
   );
 
   // Cycle through each test group.
-//  $header = array(t('Message'), t('Group'), t('Filename'), t('Line'), t('Function'), array('colspan' => 2, 'data' => t('Status')));
   $header = array(t('Message'), t('Group'), t('Filename'), t('Line'), t('Function'), t('Status'));
   $form['result']['results'] = array();
-  $classes = simpletest_test_get_all_classes(); // Drupal 6.
+  $classes = simpletest_test_get_all_classes();
+
   foreach ($results as $group => $assertions) {
-    require_once $classes[$group]['file']; // Drupal 6.
+    require_once $classes[$group]['file'];
 
     // Create group fieldset with summary information.
     $info = call_user_func(array($group, 'getInfo'));
@@ -275,17 +274,11 @@ function simpletest_result_form(&$form_s
       if ($assertion->message_group == 'Debug') {
         $class = 'simpletest-debug';
       }
-//      $rows[] = array('data' => $row, 'class' => array($class));
       $rows[] = array('data' => $row, 'class' => $class);
 
       $group_summary['#' . $assertion->status]++;
       $form['result']['summary']['#' . $assertion->status]++;
     }
-//    $form['result']['results'][$group]['table'] = array(
-//      '#theme' => 'table',
-//      '#header' => $header,
-//      '#rows' => $rows,
-//    );
     $form['result']['results'][$group]['table'] = array(
       '#type' => 'markup',
       '#value' => theme('table', $header, $rows),
@@ -303,12 +296,10 @@ function simpletest_result_form(&$form_s
   $form['result']['summary']['#ok'] = $form['result']['summary']['#fail'] + $form['result']['summary']['#exception'] == 0;
 
   // Actions.
-//  $form['#action'] = url('admin/config/development/testing/results/re-run');
   $form['#action'] = url('admin/build/testing/results/re-run');
   $form['action'] = array(
     '#type' => 'fieldset',
     '#title' => t('Actions'),
-//    '#attributes' => array('class' => array('container-inline')),
     '#attributes' => array('class' => 'container-inline'),
     '#weight' => -11,
   );
@@ -340,7 +331,6 @@ function simpletest_result_form(&$form_s
   );
 
   $form['action']['return'] = array(
-//    '#markup' => l(t('Return to list'), 'admin/config/development/testing'),
     '#type' => 'markup',
     '#value' => l(t('Return to list'), 'admin/build/testing'),
   );
@@ -362,7 +352,7 @@ function simpletest_result_form_submit($
   if ($form_state['values']['filter'] == 'all') {
     $classes = array_merge($pass, $fail);
   }
-  else if ($form_state['values']['filter'] == 'pass') {
+  elseif ($form_state['values']['filter'] == 'pass') {
     $classes = $pass;
   }
   else {
@@ -380,12 +370,13 @@ function simpletest_result_form_submit($
   }
 
   simpletest_test_form_submit(array(), $form_state_execute);
+  $form_state['redirect'] = $form_state_execute['redirect'];
 }
 
 /**
- * Add wrapper div with class based on summary status.
+ * Returns HTML for the summary status of a simpletest result.
  *
- * @return HTML output.
+ * @ingroup themeable
  */
 function theme_simpletest_result_summary($form) {
   return '<div class="simpletest-' . ($form['#ok'] ? 'pass' : 'fail') . '">' . _simpletest_format_summary_line($form) . '</div>';
@@ -398,19 +389,9 @@ function theme_simpletest_result_summary
  * @return Array of results grouped by test_class.
  */
 function simpletest_result_get($test_id) {
-//  $results = db_select('simpletest')
-//    ->fields('simpletest')
-//    ->condition('test_id', $test_id)
-//    ->orderBy('test_class')
-//    ->orderBy('message_id')
-//    ->execute();
-  $results = db_query('SELECT *
-                       FROM {simpletest}
-                       WHERE test_id = %d
-                       ORDER BY test_class, message_id', $test_id);
+  $results = db_query("SELECT * FROM {simpletest} WHERE test_id = %d ORDER BY test_class, message_id", $test_id);
 
   $test_results = array();
-//  foreach ($results as $result) {
   while ($result = db_fetch_object($results)) {
     if (!isset($test_results[$result->test_class])) {
       $test_results[$result->test_class] = array();
@@ -432,10 +413,10 @@ function simpletest_result_status_image(
 
   if (!isset($map)) {
     $map = array(
-      'pass' => theme('image', 'misc/watchdog-ok.png'),
-      'fail' => theme('image', 'misc/watchdog-error.png'),
-      'exception' => theme('image', 'misc/watchdog-warning.png'),
-      'debug' => theme('image', 'misc/watchdog-warning.png'),
+      'pass' => theme('image', 'misc/watchdog-ok.png', t('Pass')),
+      'fail' => theme('image', 'misc/watchdog-error.png', t('Fail')),
+      'exception' => theme('image', 'misc/watchdog-warning.png', t('Exception')),
+      'debug' => theme('image', 'misc/watchdog-warning.png', t('Debug')),
     );
   }
   if (isset($map[$status])) {
@@ -448,8 +429,6 @@ function simpletest_result_status_image(
  * Provides settings form for SimpleTest variables.
  */
 function simpletest_settings_form(&$form_state) {
-  $form = array();
-
   $form['general'] = array(
     '#type' => 'fieldset',
     '#title' => t('General'),
@@ -457,30 +436,45 @@ function simpletest_settings_form(&$form
   $form['general']['simpletest_clear_results'] = array(
     '#type' => 'checkbox',
     '#title' => t('Clear results after each complete test suite run'),
-    '#description' => t('By default SimpleTest will clear the results after they have been viewed on the results page, but in some cases it may be useful to leave the results in the database. The results can then be viewed at <em>admin/config/development/testing/[test_id]</em>. The test ID can be found in the database, simpletest table, or kept track of when viewing the results the first time. Additionally, some modules may provide more analaysis or features that require this setting to be disabled.'),
+    '#description' => t('By default SimpleTest will clear the results after they have been viewed on the results page, but in some cases it may be useful to leave the results in the database. The results can then be viewed at <em>admin/build/testing/[test_id]</em>. The test ID can be found in the database, simpletest table, or kept track of when viewing the results the first time. Additionally, some modules may provide more analysis or features that require this setting to be disabled.'),
     '#default_value' => variable_get('simpletest_clear_results', TRUE),
   );
   $form['general']['simpletest_verbose'] = array(
     '#type' => 'checkbox',
     '#title' => t('Provide verbose information when running tests'),
     '#description' => t('The verbose data will be printed along with the standard assertions and is useful for debugging. The verbose data will be erased between each test suite run. The verbose data output is very detailed and should only be used when debugging.'),
-    '#default_value' => variable_get('simpletest_verbose', FALSE),
+    '#default_value' => variable_get('simpletest_verbose', TRUE),
   );
 
   $form['httpauth'] = array(
     '#type' => 'fieldset',
-    '#title' => t('HTTP authentication credentials'),
+    '#title' => t('HTTP authentication'),
     '#description' => t('HTTP auth settings to be used by the SimpleTest browser during testing. Useful when the site requires basic HTTP authentication.'),
+    '#collapsible' => TRUE,
+    '#collapsed' => TRUE,
+  );
+  $form['httpauth']['simpletest_httpauth_method'] = array(
+    '#type' => 'select',
+    '#title' => t('Method'),
+    '#options' => array(
+      CURLAUTH_BASIC => t('Basic'),
+      CURLAUTH_DIGEST => t('Digest'),
+      CURLAUTH_GSSNEGOTIATE => t('GSS negotiate'),
+      CURLAUTH_NTLM => t('NTLM'),
+      CURLAUTH_ANY => t('Any'),
+      CURLAUTH_ANYSAFE => t('Any safe'),
+    ),
+    '#default_value' => variable_get('simpletest_httpauth_method', CURLAUTH_BASIC),
   );
-  $form['httpauth']['simpletest_username'] = array(
+  $form['httpauth']['simpletest_httpauth_username'] = array(
     '#type' => 'textfield',
     '#title' => t('Username'),
-    '#default_value' => variable_get('simpletest_username', ''),
+    '#default_value' => variable_get('simpletest_httpauth_username', ''),
   );
-  $form['httpauth']['simpletest_password'] = array(
+  $form['httpauth']['simpletest_httpauth_password'] = array(
     '#type' => 'textfield',
     '#title' => t('Password'),
-    '#default_value' => variable_get('simpletest_password', ''),
+    '#default_value' => variable_get('simpletest_httpauth_password', ''),
   );
 
   return system_settings_form($form);
Index: files/README.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/files/Attic/README.txt,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 README.txt
--- files/README.txt	14 Sep 2009 23:05:19 -0000	1.1.2.3
+++ files/README.txt	12 Nov 2010 23:46:51 -0000
@@ -1,6 +1,5 @@
 $Id: README.txt,v 1.1.2.3 2009/09/14 23:05:19 boombatower Exp $
-Core: Id: README.txt,v 1.1 2008/04/20 18:23:30 dries Exp
 
 These files are use in some tests that upload files or other operations were
 a file is useful. These files are copied to the files directory as specified
-in the site settings. Other tests files are generated in order to save space.
\ No newline at end of file
+in the site settings. Other tests files are generated in order to save space.
