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()
Same name and namespace in other branches
  1. 7.2 tests/registration.test \RegistrationTestCase::createRegistration()
  2. 7 tests/registration.test \RegistrationTestCase::createRegistration()

Create a Registration programmatically.

Parameters

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

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

... See full list

File

tests/registration.test, line 90
Tests for the Registration module

Class

RegistrationTestCase
@file Tests for the Registration module

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;
}