diff --git a/core/modules/user/lib/Drupal/user/Tests/Condition/UserRoleConditionTest.php b/core/modules/user/lib/Drupal/user/Tests/Condition/UserRoleConditionTest.php index fe7ea33..bd6283a 100644 --- a/core/modules/user/lib/Drupal/user/Tests/Condition/UserRoleConditionTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/Condition/UserRoleConditionTest.php @@ -39,6 +39,9 @@ class UserRoleConditionTest extends DrupalUnitTestBase { public static $modules = array('system', 'user', 'field'); + /** + * Defines test information. + */ public static function getInfo() { return array( 'name' => 'User Role Condition Plugin', @@ -47,6 +50,9 @@ public static function getInfo() { ); } + /** + * Sets up the tests. + */ protected function setUp() { parent::setUp(); @@ -59,22 +65,25 @@ protected function setUp() { $this->manager = new ConditionManager(); // Setup an anonymous user for our tests. - $anonymous = new User((array) drupal_anonymous_user(), 'user'); + $anonymous = drupal_anonymous_user(); $anonymous->save(); // Users with a non-0 uid will not get the anonymous role, so we have to // change the uid of the $this->anonymous user after saving. db_update('users')->fields(array('uid' => 0))->condition('uid', $anonymous->id())->execute(); $this->anonymous = entity_load('user', 0); - // Setup an authenticated user for our tests. - $this->authenticated = new User(array('name' => $this->randomName(), 'bundle' => 'user', 'roles' => array(DRUPAL_AUTHENTICATED_RID => DRUPAL_AUTHENTICATED_RID)), 'user'); + $this->authenticated = new User(array( + 'name' => $this->randomName(), + 'bundle' => 'user', + 'roles' => array(DRUPAL_AUTHENTICATED_RID => DRUPAL_AUTHENTICATED_RID) + ), 'user'); $this->authenticated->save(); } /** * Tests conditions. */ - function testConditions() { + public function testConditions() { // Grab the user role condition and configure it to check against // authenticated user roles. $condition = $this->manager->createInstance('user_role')