You are here

public function GroupRoleSynchronizerTest::testGetGroupRoleIdsByGroupTypes in Group 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Unit/GroupRoleSynchronizerTest.php \Drupal\Tests\group\Unit\GroupRoleSynchronizerTest::testGetGroupRoleIdsByGroupTypes()

@covers ::getGroupRoleIdsByGroupTypes @depends testGetGroupRoleId

File

tests/src/Unit/GroupRoleSynchronizerTest.php, line 69

Class

GroupRoleSynchronizerTest
Tests the outsider group role synchronizer service.

Namespace

Drupal\Tests\group\Unit

Code

public function testGetGroupRoleIdsByGroupTypes() {
  $this
    ->setUpConfigEntityStorage('user_role', [
    'bar',
    'baz',
  ]);
  $expected = [
    $this->groupRoleSynchronizer
      ->getGroupRoleId('foo', 'bar'),
    $this->groupRoleSynchronizer
      ->getGroupRoleId('bee', 'bar'),
    $this->groupRoleSynchronizer
      ->getGroupRoleId('foo', 'baz'),
    $this->groupRoleSynchronizer
      ->getGroupRoleId('bee', 'baz'),
  ];
  $this
    ->assertEquals($expected, $this->groupRoleSynchronizer
    ->getGroupRoleIdsByGroupTypes([
    'foo',
    'bee',
  ]));
}