diff --git a/core/modules/user/src/Tests/Views/BulkFormTest.php b/core/modules/user/src/Tests/Views/BulkFormTest.php index dc7a730..c5f4a12 100644 --- a/core/modules/user/src/Tests/Views/BulkFormTest.php +++ b/core/modules/user/src/Tests/Views/BulkFormTest.php @@ -123,10 +123,10 @@ public function testBulkFormRoles() { $this->assertEqual($expected_roles, $user->getRoles(TRUE), 'The user does not have any custom roles.'); // Attempt to assign role (without permission). - $edit = array( + $edit = [ 'user_bulk_form[3]' => TRUE, 'action' => 'user_add_role_action.' . $role->id(), - ); + ]; $this->drupalPostForm('test-user-bulk-form', $edit, t('Apply to selected items')); $this->assertText("No access to execute Add the $role_label role to the selected users on the User $username"); @@ -135,10 +135,10 @@ public function testBulkFormRoles() { $this->assertEqual($expected_roles, $user->getRoles(TRUE), 'Roles are unchanged.'); // Attempt to remove role (without permission). - $edit = array( + $edit = [ 'user_bulk_form[3]' => TRUE, 'action' => 'user_remove_role_action.' . $role->id(), - ); + ]; $this->drupalPostForm(NULL, $edit, t('Apply to selected items')); $this->assertText("No access to execute Remove the $role_label role from the selected users on the User $username"); $user_storage->resetCache([$uid]); @@ -149,10 +149,10 @@ public function testBulkFormRoles() { $this->drupalLogin($this->drupalCreateUser(['administer users', 'administer permissions'])); // Assign role to user. - $edit = array( + $edit = [ 'user_bulk_form[3]' => TRUE, 'action' => 'user_add_role_action.' . $role->id(), - ); + ]; $this->drupalPostForm('test-user-bulk-form', $edit, t('Apply to selected items')); $this->assertText("Add the $role_label role to the selected users was applied to 1 item."); $user_storage->resetCache([$uid]); @@ -161,10 +161,10 @@ public function testBulkFormRoles() { $this->assertEqual($expected_roles, $user->getRoles(TRUE), 'Role was added.'); // Remove role from user. - $edit = array( + $edit = [ 'user_bulk_form[3]' => TRUE, 'action' => 'user_remove_role_action.' . $role->id(), - ); + ]; $this->drupalPostForm('test-user-bulk-form', $edit, t('Apply to selected items')); $this->assertText("Remove the $role_label role from the selected users was applied to 1 item."); $user_storage->resetCache([$uid]); diff --git a/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php b/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php index 6b774dc..f1e1ef0 100644 --- a/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php +++ b/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php @@ -44,7 +44,7 @@ class UserAccessControlHandlerTest extends UnitTestCase { * * @var \Drupal\Core\Session\AccountInterface */ - protected $admin; + protected $admin_users; /** * A user with 'administer permissions' permission. @@ -98,8 +98,8 @@ protected function setUp() { ->method('id') ->will($this->returnValue(2)); - $this->admin = $this->getMock('\Drupal\Core\Session\AccountInterface'); - $this->admin + $this->admin_users = $this->getMock('\Drupal\Core\Session\AccountInterface'); + $this->admin_users ->expects($this->any()) ->method('hasPermission') ->will($this->returnValueMap([ @@ -197,7 +197,7 @@ public function userNameProvider() { ], // The users-administrator user has full access. [ - 'viewer' => 'admin', + 'viewer' => 'admin_users', 'target' => 'owner', 'view' => TRUE, 'edit' => TRUE, @@ -255,7 +255,7 @@ public function hiddenUserSettingsProvider() { ]; $access_info[] = [ 'field' => $field, - 'viewer' => 'admin', + 'viewer' => 'admin_users', 'target' => 'owner', 'view' => TRUE, 'edit' => TRUE, @@ -311,7 +311,7 @@ public function adminFieldAccessProvider() { ]; $access_info[] = [ 'field' => $field, - 'viewer' => 'admin', + 'viewer' => 'admin_users', 'target' => 'owner', 'view' => TRUE, 'edit' => TRUE, @@ -331,7 +331,7 @@ public function testPasswordAccess($viewer, $target, $view, $edit) { } /** - * Provides test data for passwordAccessProvider(). + * Provides test data for testPasswordAccess(). */ public function passwordAccessProvider() { $pass_access = [ @@ -357,7 +357,7 @@ public function passwordAccessProvider() { 'edit' => TRUE, ], [ - 'viewer' => 'admin', + 'viewer' => 'admin_users', 'target' => 'owner', 'view' => FALSE, 'edit' => TRUE, @@ -382,10 +382,10 @@ public function testRolesAccess($viewer, $target, $view, $edit) { } /** - * Provides test data for passwordAccessProvider(). + * Provides test data for testRolesAccess(). */ public function rolesAccessProvider() { - $pass_access = [ + $role_access = [ [ 'viewer' => 'viewer', 'target' => 'viewer', @@ -405,7 +405,7 @@ public function rolesAccessProvider() { 'edit' => FALSE, ], [ - 'viewer' => 'admin', + 'viewer' => 'admin_users', 'target' => 'owner', 'view' => FALSE, 'edit' => FALSE, @@ -417,7 +417,7 @@ public function rolesAccessProvider() { 'edit' => TRUE, ], ]; - return $pass_access; + return $role_access; } /** @@ -447,7 +447,7 @@ public function createdAccessProvider() { 'edit' => FALSE, ], [ - 'viewer' => 'admin', + 'viewer' => 'admin_users', 'target' => 'owner', 'view' => TRUE, 'edit' => TRUE, @@ -492,7 +492,7 @@ public function NonExistingFieldAccessProvider() { 'edit' => TRUE, ], [ - 'viewer' => 'admin', + 'viewer' => 'admin_users', 'target' => 'owner', 'view' => TRUE, 'edit' => TRUE,