You are here

public function TaxonomyTermReferenceSelectSynonymsWebTestCase::setUp in Synonyms 7

SetUp method.

Overrides AbstractSelectSynonymsWebTestCase::setUp

File

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

Class

TaxonomyTermReferenceSelectSynonymsWebTestCase
Test synonyms friendly select widget for taxonomy term reference field.

Code

public function setUp($modules = array()) {
  parent::setUp($modules);
  $this->reference_field = array(
    'type' => 'taxonomy_term_reference',
    'field_name' => 'synonyms_term',
    'cardinality' => FIELD_CARDINALITY_UNLIMITED,
    'settings' => array(
      'allowed_values' => array(
        array(
          'vocabulary' => $this->vocabulary->machine_name,
          'parent' => 0,
        ),
      ),
    ),
  );
  $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_taxonomy_term',
    ),
  );
  $this->reference_instance = field_create_instance($this->reference_instance);
}