You are here

public function EntityReferenceSelectSynonymsWebTestCase::setUp in Synonyms 7

SetUp method.

Overrides AbstractSelectSynonymsWebTestCase::setUp

File

./synonyms.test, line 1588
Tests for the Synonyms module.

Class

EntityReferenceSelectSynonymsWebTestCase
Test synonyms friendly select widget for entity reference field type.

Code

public function setUp($modules = array()) {
  $modules[] = 'entityreference';
  parent::setUp($modules);
  $this->reference_field = array(
    'type' => 'entityreference',
    'field_name' => 'synonyms_term',
    'cardinality' => FIELD_CARDINALITY_UNLIMITED,
    'settings' => array(
      'target_type' => 'taxonomy_term',
      'handler_settings' => array(),
    ),
  );
  $this->reference_field = field_create_field($this->reference_field);
  $this->reference_instance = array(
    'field_name' => $this->reference_field['field_name'],
    'entity_type' => 'node',
    'bundle' => $this->bundle,
    'label' => 'Synonym Terms Select',
    'widget' => array(
      'type' => 'synonyms_select_entity',
    ),
  );
  $this->reference_instance = field_create_instance($this->reference_instance);
}