diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-03-27 06:03:21 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-03-27 06:03:21 +0000 |
commit | e6059d4b1e7f78acb0bf36a2fcf54e34eb8121c2 (patch) | |
tree | d31713efd22b120d712d9d044044000692bc8247 /modules/field/tests | |
parent | 8439d8df63280f2b9be98d8348aaf582df96e035 (diff) | |
download | brdo-e6059d4b1e7f78acb0bf36a2fcf54e34eb8121c2.tar.gz brdo-e6059d4b1e7f78acb0bf36a2fcf54e34eb8121c2.tar.bz2 |
#610072 by boombatower, chx, effulgentsia, and yched: Fixed setUp() function accepting array as arguments.
Diffstat (limited to 'modules/field/tests')
-rw-r--r-- | modules/field/tests/field.test | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/modules/field/tests/field.test b/modules/field/tests/field.test index ed02a14f4..78afaf16f 100644 --- a/modules/field/tests/field.test +++ b/modules/field/tests/field.test @@ -15,11 +15,14 @@ class FieldTestCase extends DrupalWebTestCase { /** * 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 DrupalWebTestCase { } 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); |