You are here

public function OgMembershipTest::testGetOwnerOnNewMembership in Organic groups 8

Tests getting the owner of a newly created membership.

@covers ::getOwner

File

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

Class

OgMembershipTest
Tests the OgMembership entity.

Namespace

Drupal\Tests\og\Kernel\Entity

Code

public function testGetOwnerOnNewMembership() {

  // A brand new entity does not have an owner set yet. It should throw a
  // logic exception.
  $membership = OgMembership::create();
  $this
    ->expectException(\LogicException::class);
  $membership
    ->getOwner();
}