public function GroupCreatorTest::testCreatorGetsMembership in Group 8
Same name and namespace in other branches
- 2.0.x tests/src/Kernel/GroupCreatorTest.php \Drupal\Tests\group\Kernel\GroupCreatorTest::testCreatorGetsMembership()
Tests that a group creator is automatically a member.
File
- tests/
src/ Kernel/ GroupCreatorTest.php, line 39
Class
- GroupCreatorTest
- Tests the behavior of group creators.
Namespace
Drupal\Tests\group\KernelCode
public function testCreatorGetsMembership() {
$group = $this
->createGroup();
$account = $this
->getCurrentUser();
$this
->assertNotFalse($group
->getMember($account), 'Membership could be loaded for the group creator.');
$this
->assertCount(0, $this
->getCreatorRoles($account, $group), 'Membership has zero roles.');
}