$remove_role_plugin = new AddRoleUser($config, 'user_add_role_action', ['type' => 'user'], $this->userRoleEntityType);

$remove_role_plugin->execute($this->account);

I guess it was borrowed from RemoveRoleUserTest class.

Comments

Chi created an issue. See original summary.

pramodga’s picture

Assigned: Unassigned » pramodga
pramodga’s picture

Status: Active » Needs review
StatusFileSize
new1.46 KB

Hello Chi,

I've rename the variable names to avoid the ambiguity.

pramodga’s picture

Assigned: pramodga » Unassigned
chi’s picture

Status: Needs review » Reviewed & tested by the community

Thanks.

naveenvalecha’s picture

LGTM

Thanks!

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/user/tests/src/Unit/Plugin/Action/AddRoleUserTest.php
@@ -41,9 +41,9 @@ public function testExecuteAddNonExistingRole() {
-    $remove_role_plugin = new AddRoleUser($config, 'user_remove_role_action', ['type' => 'user'], $this->userRoleEntityType);
+    $add_role_plugin = new AddRoleUser($config, 'user_remove_role_action', ['type' => 'user'], $this->userRoleEntityType);

Hum, why is this instantiated from the remove role action plugin but still with the add role class? That sounds contradictory.

chi’s picture

Most likely that code was copied from RemoveRoleUserTest as is. I suppose it works because second constructor parameter (plugin ID) is not used in this case. However it certainly needs to be changed to user_add_role_action.

pk188’s picture

Status: Needs work » Needs review
StatusFileSize
new1.31 KB

Updated according to #8.

chi’s picture

Status: Needs review » Reviewed & tested by the community

Back to RTBC.

gábor hojtsy’s picture

Title: Rename plugin variable in AddRoleUserTest class » Fix incorrect plugin variable names in AddRoleUserTest

  • Gábor Hojtsy committed 875c2e5 on 8.3.x
    Issue #2889433 by pramodga, pk188, Chi: Fix incorrect plugin variable...
gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Looks better, thanks. Committed.

  • Gábor Hojtsy committed cf07252 on 8.4.x
    Issue #2889433 by pramodga, pk188, Chi: Fix incorrect plugin variable...
gábor hojtsy’s picture

Version: 8.4.x-dev » 8.3.x-dev

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.