You are here

public function OgMembershipTest::testGetRolesFromMembershipWithoutGroup in Organic groups 8

Tests that we can retrieve the (empty) roles list from a new membership.

If a membership is newly created and doesn't have a group associated with it yet, it should still be possible to get the (empty) list of roles without getting any errors.

@covers ::getRoles

File

tests/src/Kernel/Entity/OgMembershipTest.php, line 782

Class

OgMembershipTest
Tests the OgMembership entity.

Namespace

Drupal\Tests\og\Kernel\Entity

Code

public function testGetRolesFromMembershipWithoutGroup() {
  $membership = OgMembership::create();
  $roles = $membership
    ->getRoles();
  $this
    ->assertEquals([], $roles);
}