You are here

function RegistrationTestCase::createRegistration in Entity Registration 8.2

Same name in this branch
  1. 8.2 tests/registration.test \RegistrationTestCase::createRegistration()
  2. 8.2 src/RegistrationTestCase.php \Drupal\registration\RegistrationTestCase::createRegistration()

Create a Registration programmatically.

Parameters

array $values: Additional properties to add to registration entity.

5 calls to RegistrationTestCase::createRegistration()
RegistrationAPITestCase::testHookAccess in src/RegistrationAPITestCase.php
Test hook_registration_access().
RegistrationStandardTestCase::testHostEntityBroadcastForm in src/RegistrationStandardTestCase.php
Tests email broadcast functionality.
RegistrationStandardTestCase::testHostRegistrationStatus in src/RegistrationStandardTestCase.php
Check internal status modifiers.
RegistrationStandardTestCase::testRegistrationHostDelete in src/RegistrationStandardTestCase.php
RegistrationStandardTestCase::testUserCancel in src/RegistrationStandardTestCase.php
Ensure registrations are processed when a user is cancelled.

File

src/RegistrationTestCase.php, line 91
Tests for the Registration module

Class

RegistrationTestCase
@file Tests for the Registration module

Namespace

Drupal\registration

Code

function createRegistration(array $values = array()) {
  $registration = \Drupal::entityManager()
    ->getStorage('registration')
    ->create(array(
    'entity_type' => $this->host_entity_type,
    'entity_id' => $this->host_entity_id,
    'type' => $this->registration_type_name,
  ) + $values);
  $registration
    ->save();
  return $registration;
}