protected function EntityTranslationUITest::setupTestFields

Creates the test fields.

2 calls to EntityTranslationUITest::setupTestFields()
CommentTranslationUITest::setupTestFields in drupal/core/modules/comment/lib/Drupal/comment/Tests/CommentTranslationUITest.php
Overrides \Drupal\translation_entity\Tests\EntityTranslationUITest::setupTestFields().
EntityTranslationUITest::setUp in drupal/core/modules/translation_entity/lib/Drupal/translation_entity/Tests/EntityTranslationUITest.php
Overrides \Drupal\simpletest\WebTestBase::setUp().
2 methods override EntityTranslationUITest::setupTestFields()
CommentTranslationUITest::setupTestFields in drupal/core/modules/comment/lib/Drupal/comment/Tests/CommentTranslationUITest.php
Overrides \Drupal\translation_entity\Tests\EntityTranslationUITest::setupTestFields().
ConfigTestTranslationUITest::setupTestFields in drupal/core/modules/translation_entity/lib/Drupal/translation_entity/Tests/ConfigTestTranslationUITest.php
Overrides EntityTranslationUITest::setupTestFields().

File

drupal/core/modules/translation_entity/lib/Drupal/translation_entity/Tests/EntityTranslationUITest.php, line 119
Definition of Drupal\entity\Tests\EntityTranslationUITest.

Class

EntityTranslationUITest
Tests the Entity Translation UI.

Namespace

Drupal\translation_entity\Tests

Code

protected function setupTestFields() {
  $this->fieldName = 'field_test_et_ui_test';
  $field = array(
    'field_name' => $this->fieldName,
    'type' => 'text',
    'cardinality' => 1,
    'translatable' => TRUE,
  );
  field_create_field($field);
  $instance = array(
    'entity_type' => $this->entityType,
    'field_name' => $this->fieldName,
    'bundle' => $this->bundle,
    'label' => 'Test translatable text-field',
    'widget' => array(
      'type' => 'text_textfield',
      'weight' => 0,
    ),
  );
  field_create_instance($instance);
}