You are here

public function GroupTest::testAddMember in Group 8

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

Tests the addition of a member to a group.

@covers ::addMember

File

tests/src/Kernel/GroupTest.php, line 36

Class

GroupTest
Tests the general behavior of group entities.

Namespace

Drupal\Tests\group\Kernel

Code

public function testAddMember() {
  $account = $this
    ->createUser();
  $this
    ->assertFalse($this->group
    ->getMember($account), 'The user is not automatically member of the group.');
  $this->group
    ->addMember($account);
  $this
    ->assertNotFalse($this->group
    ->getMember($account), 'Successfully added a member.');
}