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/simpletest | |
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/simpletest')
-rw-r--r-- | modules/simpletest/drupal_web_test_case.php | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php index 42ac83058..b6bda06c9 100644 --- a/modules/simpletest/drupal_web_test_case.php +++ b/modules/simpletest/drupal_web_test_case.php @@ -1097,9 +1097,10 @@ class DrupalWebTestCase extends DrupalTestCase { * 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 DrupalTestCase { // 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); } |