You are here

protected function GroupRoleStorageTest::compareMemberRoles in Group 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Kernel/GroupRoleStorageTest.php \Drupal\Tests\group\Kernel\GroupRoleStorageTest::compareMemberRoles()

Asserts that the test user's group roles match a provided list of IDs.

Parameters

string[] $expected: The group role IDs we expect the user to have.

bool $include_implied: Whether to include internal group roles.

string $message: The message to display for the assertion.

1 call to GroupRoleStorageTest::compareMemberRoles()
GroupRoleStorageTest::testLoadByUserAndGroup in tests/src/Kernel/GroupRoleStorageTest.php
Tests the loading of group roles by user and group.

File

tests/src/Kernel/GroupRoleStorageTest.php, line 128

Class

GroupRoleStorageTest
Tests the behavior of group role storage handler.

Namespace

Drupal\Tests\group\Kernel

Code

protected function compareMemberRoles($expected, $include_implied, $message) {
  $group_roles = $this->storage
    ->loadByUserAndGroup($this->account, $this->group, $include_implied);
  $this
    ->assertEqualsCanonicalizing($expected, array_keys($group_roles), $message);
}