You are here

public function GroupContentStorageTest::testCreateWithBundle in Group 8

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

Tests the creation of a GroupContent entity using a bundle.

@covers ::createForEntityInGroup

File

tests/src/Kernel/GroupContentStorageTest.php, line 138

Class

GroupContentStorageTest
Tests the behavior of group content storage handler.

Namespace

Drupal\Tests\group\Kernel

Code

public function testCreateWithBundle() {
  $group = $this
    ->createGroup();
  $subgroup = $this
    ->createGroup();
  $group_content = $this->storage
    ->createForEntityInGroup($subgroup, $group, 'group_as_content');
  $this
    ->assertInstanceOf('\\Drupal\\group\\Entity\\GroupContentInterface', $group_content, 'Created a GroupContent entity using a bundle-specific plugin.');
}