You are here

protected function UserRoleTest::assertNotHasRole in Feeds 8.3

Asserts that the given user NOT 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 NOT have.

string $message: (optional) Assertion message.

4 calls to UserRoleTest::assertNotHasRole()
UserRoleTest::testImportByRoleLabels in tests/src/Kernel/Feeds/Target/UserRoleTest.php
Tests mapping to role by role label.
UserRoleTest::testRevokeRoles in tests/src/Kernel/Feeds/Target/UserRoleTest.php
Tests that roles can be revoked and that only allowed roles are revoked.
UserRoleTest::testWithAllowedRoles in tests/src/Kernel/Feeds/Target/UserRoleTest.php
Tests mapping to role using only allowed roles.
UserRoleTest::testWithoutRoleCreation in tests/src/Kernel/Feeds/Target/UserRoleTest.php
Tests mapping to role without automatically creating new roles.

File

tests/src/Kernel/Feeds/Target/UserRoleTest.php, line 108

Class

UserRoleTest
@coversDefaultClass \Drupal\feeds\Feeds\Target\UserRole @group feeds

Namespace

Drupal\Tests\feeds\Kernel\Feeds\Target

Code

protected function assertNotHasRole(UserInterface $account, $rid, $message = '') {
  $this
    ->assertFalse($account
    ->hasRole($rid), $message);
}