You are here

public function OgMembershipTest::testGetGroupOnNewMembership in Organic groups 8

Tests getting the group from a new membership.

@covers ::getGroup

File

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

Class

OgMembershipTest
Tests the OgMembership entity.

Namespace

Drupal\Tests\og\Kernel\Entity

Code

public function testGetGroupOnNewMembership() {
  $membership = OgMembership::create();

  // When no group has been set yet, the method should throw an assertion.
  $this
    ->expectException(\LogicException::class);
  $membership
    ->getGroup();
}