You are here

protected function GroupContentStorageTest::setUp in Group 8

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

Overrides GroupKernelTestBase::setUp

File

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

Class

GroupContentStorageTest
Tests the behavior of group content storage handler.

Namespace

Drupal\Tests\group\Kernel

Code

protected function setUp() {
  parent::setUp();
  $this->storage = $this->entityTypeManager
    ->getStorage('group_content');

  // Enable the test plugins on the default group type.

  /** @var \Drupal\group\Entity\Storage\GroupContentTypeStorageInterface $storage */
  $group_type = $this->entityTypeManager
    ->getStorage('group_type')
    ->load('default');
  $storage = $this->entityTypeManager
    ->getStorage('group_content_type');
  $storage
    ->createFromPlugin($group_type, 'user_as_content')
    ->save();
  $storage
    ->createFromPlugin($group_type, 'group_as_content')
    ->save();
}