You are here

protected function RestfulCommentTestCase::addTextField in RESTful 7.2

Adds a text field.

Parameters

string $entity_type: The entity type.

string $bundle.: The bundle name.

string $field_name.: The field name.

1 call to RestfulCommentTestCase::addTextField()
RestfulCommentTestCase::setUp in tests/RestfulCommentTestCase.test
Sets up a Drupal site for running functional and integration tests.

File

tests/RestfulCommentTestCase.test, line 241
Contains RestfulCommentTestCase

Class

RestfulCommentTestCase
@file Contains RestfulCommentTestCase

Code

protected function addTextField($entity_type, $bundle, $field_name) {

  // Text - single, with text processing.
  $field = array(
    'field_name' => $field_name,
    'type' => 'text_long',
    'entity_types' => array(
      $entity_type,
    ),
    'cardinality' => 1,
  );
  field_create_field($field);
  $instance = array(
    'field_name' => $field_name,
    'bundle' => $bundle,
    'entity_type' => $entity_type,
    'label' => t('Text single with text processing'),
    'settings' => array(
      'text_processing' => 1,
    ),
  );
  field_create_instance($instance);
}