You are here

public function GroupRoleStorageTest::testLoadSynchronizedByUserRoles in Group 2.0.x

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

Tests the loading of synchronized group roles by user roles.

@covers ::loadSynchronizedByUserRoles

File

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

Class

GroupRoleStorageTest
Tests the behavior of group role storage handler.

Namespace

Drupal\Tests\group\Kernel

Code

public function testLoadSynchronizedByUserRoles() {
  $actual = array_keys($this->storage
    ->loadSynchronizedByUserRoles([
    'test',
  ]));
  $expected = [
    $this->groupRoleSynchronizer
      ->getGroupRoleId('default', 'test'),
    $this->groupRoleSynchronizer
      ->getGroupRoleId('other', 'test'),
  ];
  $this
    ->assertEqualsCanonicalizing($expected, $actual, 'Can load synchronized group roles by user roles.');
}