? .settings
Index: modules/field/tests/field.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/tests/field.test,v
retrieving revision 1.24
diff -u -p -r1.24 field.test
--- modules/field/tests/field.test	26 Mar 2010 17:14:45 -0000	1.24
+++ modules/field/tests/field.test	26 Mar 2010 23:15:17 -0000
@@ -15,11 +15,14 @@ class FieldTestCase extends DrupalWebTes
   /**
    * Set the default field storage backend for fields created during tests.
    */
-  function setUp() {
-    // Call parent::setUp().
-    // See http://www.php.net/manual/en/function.call-user-func-array.php#73105.
-    $args = func_get_args();
-    call_user_func_array(array($this, 'parent::setUp'), $args);
+  function setUp($modules = array()) {
+    // Since this is a base class for many test cases, support the same
+    // flexibility that DrupalWebTestCase::setUp() has for the modules to be
+    // passed in as either an array or a variable number of string arguments.
+    if (!is_array($modules)) {
+      $modules = func_get_args();
+    }
+    parent::setUp($modules);
     // Set default storage backend.
     variable_set('field_storage_default', $this->default_storage);
   }
@@ -69,8 +72,17 @@ class FieldTestCase extends DrupalWebTes
 }
 
 class FieldAttachTestCase extends FieldTestCase {
-  function setUp() {
-    parent::setUp('field_test');
+  function setUp($modules = array()) {
+    // Since this is a base class for many test cases, support the same
+    // flexibility that DrupalWebTestCase::setUp() has for the modules to be
+    // passed in as either an array or a variable number of string arguments.
+    if (!is_array($modules)) {
+      $modules = func_get_args();
+    }
+    if (!in_array('field_test', $modules)) {
+      $modules[] = 'field_test';
+    }
+    parent::setUp($modules);
 
     $this->field_name = drupal_strtolower($this->randomName() . '_field_name');
     $this->field = array('field_name' => $this->field_name, 'type' => 'test_field', 'cardinality' => 4);
Index: modules/simpletest/drupal_web_test_case.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/drupal_web_test_case.php,v
retrieving revision 1.204
diff -u -p -r1.204 drupal_web_test_case.php
--- modules/simpletest/drupal_web_test_case.php	26 Mar 2010 18:58:12 -0000	1.204
+++ modules/simpletest/drupal_web_test_case.php	26 Mar 2010 23:17:20 -0000
@@ -1097,9 +1097,10 @@ class DrupalWebTestCase extends DrupalTe
    * is created with the same name as the database prefix.
    *
    * @param ...
-   *   List of modules to enable for the duration of the test.
+   *   List of modules to enable for the duration of the test. This can be
+   *   either a single array or a variable number of string arguments.
    */
-  protected function setUp() {
+  protected function setUp($modules = array()) {
     global $db_prefix, $user, $language, $conf;
 
     // Store necessary current values before switching to prefixed database.
@@ -1159,8 +1160,14 @@ class DrupalWebTestCase extends DrupalTe
     // Install the modules specified by the default profile.
     module_enable($profile_details['dependencies'], FALSE);
 
-    // Install modules needed for this test.
-    if ($modules = func_get_args()) {
+    // Install modules needed for this test. This could have been passed in as
+    // either a single array argument or a variable number of string arguments.
+    // @todo Remove this compatibility layer in Drupal 8, and only accept
+    // $modules as a single array argument.
+    if (!is_array($modules)) {
+      $modules = func_get_args();
+    }
+    if ($modules) {
       module_enable($modules, TRUE);
     }
 
