? .svn
? frameworkpatch
? patch.patch
? php5powah_tests.patch
? prefixing.patch
? simpletest
? simpletest_orig
Index: drupal_test_case.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/drupal_test_case.php,v
retrieving revision 1.62
diff -b -u -p -r1.62 drupal_test_case.php
--- drupal_test_case.php	22 Mar 2008 05:08:39 -0000	1.62
+++ drupal_test_case.php	23 Mar 2008 04:44:54 -0000
@@ -448,7 +448,7 @@ class DrupalTestCase extends UnitTestCas
    * Also, see the description of $curl_options among the properties.
    */
   protected function curlConnect() {
-    global $base_url;
+    global $base_url, $db_prefix;
     if (!isset($this->ch)) {
       $this->ch = curl_init();
       $curl_options = $this->curl_options + array(
@@ -457,6 +457,9 @@ class DrupalTestCase extends UnitTestCas
         CURLOPT_FOLLOWLOCATION => TRUE,
         CURLOPT_RETURNTRANSFER => TRUE,
       );
+      if (preg_match('/simpletest\d+/', $db_prefix)) {
+        $curl_options[CURLOPT_USERAGENT] = $db_prefix;
+      }
       if (!isset($curl_options[CURLOPT_USERPWD]) && ($auth = variable_get('simpletest_httpauth_username', ''))) {
         if ($pass = variable_get('simpletest_httpauth_pass', '')) {
           $auth .= ':'. $pass;
Index: simpletest.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/simpletest.module,v
retrieving revision 1.36
diff -b -u -p -r1.36 simpletest.module
--- simpletest.module	21 Mar 2008 23:29:49 -0000	1.36
+++ simpletest.module	23 Mar 2008 04:44:54 -0000
@@ -206,10 +206,25 @@ function simpletest_overview_form() {
  * @param boolean $html_reporter true if you want results in simple html, FALSE for full drupal page
  */
 function simpletest_run_tests($testlist = NULL, $reporter = 'drupal') {
-  global $test_running;
+  global $test_running, $db_prefix, $simpletest_ua_handling;
+  static $db_prefix_original;
   if (!$test_running) {
     $test_running = TRUE;
     $test = simpletest_get_total_test($testlist);
+    if ($simpletest_ua_handling) {
+      $db_prefix_original = $db_prefix;
+      $db_prefix = 'simpletest'. mt_rand(1000, 1000000);
+      include_once './includes/install.inc';
+      drupal_install_system();
+      $module_list = drupal_verify_profile('default', 'en');
+      drupal_install_modules($module_list);
+      default_profile_tasks();
+      menu_rebuild();
+      actions_synchronize();
+      _drupal_flush_css_js();
+      variable_set('install_profile', 'default');
+      variable_set('install_task', 'profile-finished');
+    }
     switch ($reporter) {
       case 'text':
         $reporter = &new TextReporter();
@@ -227,6 +242,12 @@ function simpletest_run_tests($testlist 
 
     cache_clear_all();
     $results = $test->run($reporter);
+    $schema = drupal_get_schema(NULL, TRUE);
+    $ret = array();
+    foreach ($schema as $name => $table) {
+      db_drop_table($ret, $name);
+    }
+    $db_prefix = $db_prefix_original;
     $test_running = FALSE;
     
     switch (get_class($reporter)) {
