You are here

function RegistrationStandardTestCase::testHostEntitySettings in Entity Registration 8.2

Same name in this branch
  1. 8.2 tests/registration.test \RegistrationStandardTestCase::testHostEntitySettings()
  2. 8.2 src/RegistrationStandardTestCase.php \Drupal\registration\RegistrationStandardTestCase::testHostEntitySettings()
Same name and namespace in other branches
  1. 7.2 tests/registration.test \RegistrationStandardTestCase::testHostEntitySettings()
  2. 7 tests/registration.test \RegistrationStandardTestCase::testHostEntitySettings()

Tests entity update helper.

File

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

Class

RegistrationStandardTestCase
Creates a registration type Create node entity type ensure registration type exists

Code

function testHostEntitySettings() {
  $settings = array(
    'status' => 1,
    'settings' => array(
      'random_string' => $this
        ->randomName(),
    ),
  );
  $this
    ->setHostEntitySettings($settings);
  $db_settings = registration_entity_settings($this->host_entity_type, $this->host_entity_id);
  $this
    ->assertTrue($settings['settings']['random_string'] === $db_settings['settings']['random_string'], t('Saving host entity registration settings'), 'Registration');

  // Tests static caching.
  $settings = array(
    'status' => 0,
    'settings' => array(
      'random_string' => $this
        ->randomName(),
    ),
  );
  $this
    ->setHostEntitySettings($settings);
  $db_settings = registration_entity_settings($this->host_entity_type, $this->host_entity_id, TRUE);
  $this
    ->assertTrue($settings['settings']['random_string'] === $db_settings['settings']['random_string'], t('Saving host entity registration settings.'), 'Registration');
}