You are here

protected function DefaultRoleEventIntegrationTest::setUp in Organic groups 8

Overrides KernelTestBase::setUp

File

tests/src/Kernel/DefaultRoleEventIntegrationTest.php, line 49

Class

DefaultRoleEventIntegrationTest
Tests the implementation of the DefaultRoleEvent in the 'og' module.

Namespace

Drupal\Tests\og\Kernel

Code

protected function setUp() : void {
  parent::setUp();
  $this->eventDispatcher = $this->container
    ->get('event_dispatcher');
  $this->ogRoleStorage = $this->container
    ->get('entity_type.manager')
    ->getStorage('og_role');

  // Create a group entity type. Note that since we are using the EntityTest
  // entity we don't actually need to create the group bundle. EntityTest does
  // not have real bundles, it just pretends it does.
  $this->groupBundleId = $this
    ->randomMachineName();
  Og::groupTypeManager()
    ->addGroup('entity_test', $this->groupBundleId);
}