You are here

public function OgMembershipTest::testGetSetOwner in Organic groups 8

Tests getting and setting owners on OgMemberships.

@covers ::getOwner @covers ::getOwnerId @covers ::setOwner

File

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

Class

OgMembershipTest
Tests the OgMembership entity.

Namespace

Drupal\Tests\og\Kernel\Entity

Code

public function testGetSetOwner() {
  $membership = OgMembership::create();
  $membership
    ->setOwner($this->user)
    ->setGroup($this->group)
    ->save();
  $this
    ->assertOwner($membership);
}