protected function EntityTranslationSyncImageTest::setupTestFields

Creates the test image field.

Overrides EntityTranslationTestBase::setupTestFields

File

drupal/core/modules/translation_entity/lib/Drupal/translation_entity/Tests/EntityTranslationSyncImageTest.php, line 55
Contains \Drupal\entity\Tests\EntityTranslationSyncImageTest.

Class

EntityTranslationSyncImageTest
Tests the Entity Translation image field synchronization capability.

Namespace

Drupal\translation_entity\Tests

Code

protected function setupTestFields() {
  $this->fieldName = 'field_test_et_ui_image';
  $this->cardinality = 3;
  $field = array(
    'field_name' => $this->fieldName,
    'type' => 'image',
    'cardinality' => $this->cardinality,
    'translatable' => TRUE,
  );
  field_create_field($field);
  $instance = array(
    'entity_type' => $this->entityType,
    'field_name' => $this->fieldName,
    'bundle' => $this->entityType,
    'label' => 'Test translatable image field',
    'settings' => array(
      'translation_sync' => array(
        'file' => FALSE,
        'alt' => 'alt',
        'title' => 'title',
      ),
    ),
  );
  field_create_instance($instance);
}