You are here

function language_hierarchy_test_install in Language Hierarchy 7

Implements hook_install().

File

tests/modules/language_hierarchy_test.install, line 6

Code

function language_hierarchy_test_install() {

  // Add a title field to the page node type.
  $field = array(
    'field_name' => 'field_title',
    'type' => 'text',
    'entity_types' => array(
      'node',
    ),
    'translatable' => TRUE,
  );
  field_create_field($field);
  $instance = array(
    'field_name' => 'field_title',
    'entity_type' => 'node',
    'bundle' => 'page',
    'label' => t('Title'),
    'widget' => array(
      'type' => 'text_textfield',
    ),
    'settings' => array(
      'display_summary' => TRUE,
    ),
    'display' => array(
      'default' => array(
        'label' => 'hidden',
        'type' => 'text_plain',
      ),
    ),
  );
  field_create_instance($instance);
  $field = array(
    'field_name' => 'field_not_title',
    'type' => 'text',
    'entity_types' => array(
      'node',
    ),
    'translatable' => TRUE,
  );
  field_create_field($field);
  $instance = array(
    'field_name' => 'field_not_title',
    'entity_type' => 'node',
    'bundle' => 'page',
    'label' => t('Not Title'),
    'widget' => array(
      'type' => 'text_textfield',
    ),
    'settings' => array(
      'display_summary' => TRUE,
    ),
    'display' => array(
      'default' => array(
        'label' => 'hidden',
        'type' => 'text_plain',
      ),
    ),
  );
  field_create_instance($instance);
}