Problem/Motivation
Currently, the "Drupal\Tests\user\Traits\UserCreationTrait::grantPermissions" method, requires two parameters a RoleInterface object and an array with permission IDs. This isn't optimal, since we can't easily get the Role object of a specific role inside our tests.
The reason behind this is, that if we create roles inside our Tests, we usually do this via "UserCreationTrait::createAdminRole()" or "UserCreationTrait::createRole()". Both of these methods only return the role ID of the newly created role. So Instead of just passing the role ID to "grantPermissions", we first need to load the Role object via the role ID and then pass the Role object to the function, which is not very intuitive.
Steps to reproduce
Proposed resolution
Change the first parameter of "UserCreationTrait::grantPermissions" from "\Drupal\user\RoleInterface $role" to "string $roleId" and adjust the method implementation accordingly.