public function GroupTest::testAddMember in Group 2.0.x
Same name and namespace in other branches
- 8 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\KernelCode
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.');
}