You are here

function RngWebTestBase::createRegistration in RNG - Events and Registrations 8

Same name and namespace in other branches
  1. 8.2 src/Tests/RngWebTestBase.php \Drupal\rng\Tests\RngWebTestBase::createRegistration()
  2. 3.x src/Tests/RngWebTestBase.php \Drupal\rng\Tests\RngWebTestBase::createRegistration()

Creates and saves a registration entity.

Parameters

\Drupal\Core\Entity\ContentEntityInterface $event: An event entity.

string $registration_type_id: A registration type ID.

Return value

\Drupal\rng\Entity\Registration A saved registration entity.

Overrides RngTestTrait::createRegistration

3 calls to RngWebTestBase::createRegistration()
RngRegistrantRouteTest::setUp in src/Tests/RngRegistrantRouteTest.php
Sets up a Drupal site for running functional and integration tests.
RngRegistrationTypeTest::testRegistrationTypeAPIDelete in src/Tests/RngRegistrationTypeTest.php
Test registration type deletion.
RngRegistrationTypeTest::testRegistrationTypes in src/Tests/RngRegistrationTypeTest.php
Test registration types in UI.

File

src/Tests/RngWebTestBase.php, line 76

Class

RngWebTestBase
Sets up page and article content types.

Namespace

Drupal\rng\Tests

Code

function createRegistration(ContentEntityInterface $event, $registration_type_id) {
  $registration = Registration::create([
    'type' => $registration_type_id,
  ])
    ->setEvent($event);
  $registration
    ->save();
  return $registration;
}