You are here

protected function RngTestTrait::createEventType in RNG - Events and Registrations 3.x

Same name and namespace in other branches
  1. 8.2 src/Tests/RngTestTrait.php \Drupal\rng\Tests\RngTestTrait::createEventType()
  2. 8 src/Tests/RngTestTrait.php \Drupal\rng\Tests\RngTestTrait::createEventType()

Creates an event type config.

Parameters

string $entity_type_id: An entity type ID.

string $bundle: An entity type bundle.

array $values: Optional values for the event type.

Return value

\Drupal\rng\Entity\EventTypeInterface An event type config.

9 calls to RngTestTrait::createEventType()
RngEventAccessTest::setUp in tests/src/Kernel/RngEventAccessTest.php
RngEventAccessWebTest::setUp in tests/src/Functional/RngEventAccessWebTest.php
RngEventMetaTest::setUp in tests/src/Kernel/RngEventMetaTest.php
RngMessageRules::setUp in tests/src/Kernel/RngMessageRules.php
RngRegistrationAccessTest::setUp in tests/src/Kernel/RngRegistrationAccessTest.php

... See full list

File

src/Tests/RngTestTrait.php, line 48

Class

RngTestTrait

Namespace

Drupal\rng\Tests

Code

protected function createEventType($entity_type_id, $bundle, $values = []) {
  $event_type = RngEventType::create($values + [
    'label' => 'Event Type A',
    'entity_type' => $entity_type_id,
    'bundle' => $bundle,
    'mirror_operation_to_event_manage' => 'update',
  ]);
  $event_type
    ->setIdentityTypeReference('user', 'user', TRUE);
  $event_type
    ->setDefaultRegistrantType('registrant');
  $event_type
    ->save();
  return $event_type;
}