protected function RngTestTrait::createEventType in RNG - Events and Registrations 8
Same name and namespace in other branches
- 8.2 src/Tests/RngTestTrait.php \Drupal\rng\Tests\RngTestTrait::createEventType()
- 3.x 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\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
File
- src/
Tests/ RngTestTrait.php, line 45
Class
Namespace
Drupal\rng\TestsCode
protected function createEventType($entity_type_id, $bundle, $values = []) {
$event_type = EventType::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;
}