diff --git a/core/modules/user/src/Plugin/views/filter/Roles.php b/core/modules/user/src/Plugin/views/filter/Roles.php index e4ea2fe..f878785 100644 --- a/core/modules/user/src/Plugin/views/filter/Roles.php +++ b/core/modules/user/src/Plugin/views/filter/Roles.php @@ -28,7 +28,7 @@ class Roles extends ManyToOne { protected $roleStorage; /** - * Constructs a Roles. + * Constructs a Roles object. * * @param array $configuration * A configuration array containing information about the plugin instance. @@ -77,8 +77,8 @@ function operators() { public function calculateDependencies() { $dependencies = array(); foreach ($this->value as $role_id) { - $role_entity = $this->roleStorage->load($role_id); - $dependencies[$role_entity->getConfigDependencyKey()][] = $role_entity->getConfigDependencyName(); + $role = $this->roleStorage->load($role_id); + $dependencies[$role->getConfigDependencyKey()][] = $role->getConfigDependencyName(); } return $dependencies; } diff --git a/core/modules/user/src/Tests/Views/HandlerFilterRolesTest.php b/core/modules/user/src/Tests/Views/HandlerFilterRolesTest.php index 43bcaf4..6ed889b 100644 --- a/core/modules/user/src/Tests/Views/HandlerFilterRolesTest.php +++ b/core/modules/user/src/Tests/Views/HandlerFilterRolesTest.php @@ -17,7 +17,8 @@ * Tests the roles filter handler. * * @group user - * @see \Drupal\user\Plugin\views\filter\Roless + * + * @see \Drupal\user\Plugin\views\filter\Roles */ class HandlerFilterRolesTest extends UserUnitTestBase { @@ -29,9 +30,9 @@ class HandlerFilterRolesTest extends UserUnitTestBase { public static $testViews = array('test_user_name'); /** - * Tests the roles filter handler. + * Tests that role filter dependencies are calculated correctly. */ - public function testFilterRoles() { + public function testDependencies() { $role = Role::create(['id' => 'test_user_role']); $role->save(); $view = View::load('test_user_name');