protected function UserRoleTest::assertHasRole in Feeds 8.3
Asserts that the given user has the given role.
Parameters
\Drupal\user\UserInterface $account: The account to check for the role.
string $rid: The expected role ID that the user should have.
string $message: (optional) Assertion message.
7 calls to UserRoleTest::assertHasRole()
- UserRoleTest::testImportByRoleLabels in tests/
src/ Kernel/ Feeds/ Target/ UserRoleTest.php - Tests mapping to role by role label.
- UserRoleTest::testNoRevokeRoles in tests/
src/ Kernel/ Feeds/ Target/ UserRoleTest.php - Tests if no roles are revoked if the option "Revoke roles" is disabled.
- UserRoleTest::testRevokeRoles in tests/
src/ Kernel/ Feeds/ Target/ UserRoleTest.php - Tests that roles can be revoked and that only allowed roles are revoked.
- UserRoleTest::testRoleCreationUsingLabel in tests/
src/ Kernel/ Feeds/ Target/ UserRoleTest.php - Tests automatically creating new roles based on label.
- UserRoleTest::testWithAllowedRoles in tests/
src/ Kernel/ Feeds/ Target/ UserRoleTest.php - Tests mapping to role using only allowed roles.
File
- tests/
src/ Kernel/ Feeds/ Target/ UserRoleTest.php, line 94
Class
- UserRoleTest
- @coversDefaultClass \Drupal\feeds\Feeds\Target\UserRole @group feeds
Namespace
Drupal\Tests\feeds\Kernel\Feeds\TargetCode
protected function assertHasRole(UserInterface $account, $rid, $message = '') {
$this
->assertTrue($account
->hasRole($rid), $message);
}