You are here

public function GroupMembershipManagerTest::testGetGroupMembershipIdsByRoleNames in Organic groups 8

Tests retrieval of group membership IDs filtered by role names.

@covers ::getGroupMembershipIdsByRoleNames

File

tests/src/Kernel/Entity/GroupMembershipManagerTest.php, line 384

Class

GroupMembershipManagerTest
Tests retrieving groups associated with a given group content.

Namespace

Drupal\Tests\og\Kernel\Entity

Code

public function testGetGroupMembershipIdsByRoleNames() {
  $membership_storage = $this->container
    ->get('entity_type.manager')
    ->getStorage('og_membership');
  $retrieve_membership_owner_id = function ($membership_id) use ($membership_storage) {

    /** @var \Drupal\og\OgMembershipInterface $membership */
    $membership = $membership_storage
      ->load($membership_id);
    return $membership
      ->getOwnerId();
  };
  $this
    ->doTestGetGroupMembershipsByRoleNames('getGroupMembershipIdsByRoleNames', $retrieve_membership_owner_id);
}