You are here

protected function RngTestTrait::createEvent 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::createEvent()
  2. 8 src/Tests/RngTestTrait.php \Drupal\rng\Tests\RngTestTrait::createEvent()

Create an event.

Return value

\Drupal\rng\EventMetaInterface

14 calls to RngTestTrait::createEvent()
RngEventAccessWebTest::testEventAccessCustomized in tests/src/Functional/RngEventAccessWebTest.php
Test event access page when using custom rules.
RngEventAccessWebTest::testEventAccessSiteDefaults in tests/src/Functional/RngEventAccessWebTest.php
Test event access page when using site defaults.
RngMessageRules::setUp in tests/src/Kernel/RngMessageRules.php
RngRegistrantRouteTest::setUp in src/Tests/RngRegistrantRouteTest.php
RngRegistrationAccessTest::testRegisterSelf in tests/src/Kernel/RngRegistrationAccessTest.php
Test register self.

... See full list

File

src/Tests/RngTestTrait.php, line 66

Class

RngTestTrait

Namespace

Drupal\rng\Tests

Code

protected function createEvent($values = []) {
  $event = EntityTest::create($values + [
    EventManagerInterface::FIELD_REGISTRATION_TYPE => $this->registrationType
      ->id(),
    EventManagerInterface::FIELD_STATUS => TRUE,
    EventManagerInterface::FIELD_ALLOW_DUPLICATE_REGISTRANTS => 0,
  ]);
  $event
    ->save();
  return $this->eventManager
    ->getMeta($event);
}