You are here

public function GroupCreatorTest::testCreatorDoesNotGetMembership in Group 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Kernel/GroupCreatorTest.php \Drupal\Tests\group\Kernel\GroupCreatorTest::testCreatorDoesNotGetMembership()

Tests that a group creator is not automatically made a member.

File

tests/src/Kernel/GroupCreatorTest.php, line 65

Class

GroupCreatorTest
Tests the behavior of group creators.

Namespace

Drupal\Tests\group\Kernel

Code

public function testCreatorDoesNotGetMembership() {

  /* @var \Drupal\group\Entity\GroupTypeInterface $group_type */
  $group_type = $this->entityTypeManager
    ->getStorage('group_type')
    ->load('default');
  $group_type
    ->set('creator_membership', FALSE);
  $group_type
    ->save();
  $group_membership = $this
    ->createGroup()
    ->getMember($this
    ->getCurrentUser());
  $this
    ->assertFalse($group_membership, 'Membership could not be loaded for the group creator.');
}