From 7bf8e72aaa3f1f287a9666a478eb190941a1758a Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 29 Apr 2009 12:04:47 +0000 Subject: - Patch #340081 by dmitrig01, boombatower: clean-up of drupalCreateUser() --- modules/simpletest/drupal_web_test_case.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'modules/simpletest') diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php index cab814725..86b827886 100644 --- a/modules/simpletest/drupal_web_test_case.php +++ b/modules/simpletest/drupal_web_test_case.php @@ -671,9 +671,9 @@ class DrupalWebTestCase { * A fully loaded user object with pass_raw property, or FALSE if account * creation fails. */ - protected function drupalCreateUser($permissions = NULL) { + protected function drupalCreateUser($permissions = array('access comments', 'access content', 'post comments', 'post comments without approval')) { // Create a role with the given permission set. - if (!($rid = $this->_drupalCreateRole($permissions))) { + if (!($rid = $this->drupalCreateRole($permissions))) { return FALSE; } @@ -705,12 +705,7 @@ class DrupalWebTestCase { * @return * Role ID of newly created role, or FALSE if role creation failed. */ - protected function _drupalCreateRole(array $permissions = NULL) { - // Generate string version of permissions list. - if ($permissions === NULL) { - $permissions = array('access comments', 'access content', 'post comments', 'post comments without approval'); - } - + protected function drupalCreateRole(array $permissions) { if (!$this->checkPermissions($permissions)) { return FALSE; } -- cgit v1.2.3