You are here

public function CreateMembershipTest::testNewGroup in Organic groups 8

Tests creating membership for an un-saved group.

@covers ::createMembership

File

tests/src/Unit/CreateMembershipTest.php, line 152

Class

CreateMembershipTest
Tests create membership helper function.

Namespace

Drupal\Tests\og\Unit

Code

public function testNewGroup() {
  $membership_manager = new MembershipManager($this->entityTypeManager
    ->reveal(), $this->groupAudienceHelper
    ->reveal(), $this->staticCache
    ->reveal());
  $membership = $membership_manager
    ->createMembership($this->group
    ->reveal(), $this->user
    ->reveal());
  $this
    ->assertInstanceOf(OgMembershipInterface::class, $membership);
}