You are here

public function RngWebTestBase::createRegistration in RNG - Events and Registrations 8.2

Same name and namespace in other branches
  1. 8 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
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 75

Class

RngWebTestBase
Sets up page and article content types.

Namespace

Drupal\rng\Tests

Code

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