You are here

function RegistrationStandardTestCase::testHostEntitySettings in Entity Registration 7

Same name and namespace in other branches
  1. 8.2 tests/registration.test \RegistrationStandardTestCase::testHostEntitySettings()
  2. 7.2 tests/registration.test \RegistrationStandardTestCase::testHostEntitySettings()

Tests entity update helper.

File

tests/registration.test, line 172
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');
}