You are here

protected function AbstractSelectSynonymsWebTestCase::createTerms in Synonyms 7

Method to initiate all necessary terms for testing.

1 call to AbstractSelectSynonymsWebTestCase::createTerms()
AbstractSelectSynonymsWebTestCase::setUp in ./synonyms.test
SetUp method.
1 method overrides AbstractSelectSynonymsWebTestCase::createTerms()
CommerceProductReferenceSelectSynonymsWebTestCase::createTerms in synonyms_commerce/synonyms_commerce.test
Method to initiate all necessary terms for testing.

File

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

Class

AbstractSelectSynonymsWebTestCase
Test "Synonyms friendly select" widget of Synonyms module.

Code

protected function createTerms() {
  $this->terms['parent_term'] = (object) array(
    'vid' => $this->vocabulary->vid,
    'name' => 'Parent Term',
    $this->fields['enabled']['field']['field_name'] => array(
      LANGUAGE_NONE => array(
        array(
          'value' => 'Parent TermA' . $this
            ->randomName(),
        ),
        array(
          'value' => 'Parent TermZ' . $this
            ->randomName(),
        ),
      ),
    ),
  );
  taxonomy_term_save($this->terms['parent_term']);
  $this->terms['child_term'] = (object) array(
    'vid' => $this->vocabulary->vid,
    'name' => 'Child Term',
    'parent' => $this->terms['parent_term']->tid,
    $this->fields['enabled']['field']['field_name'] => array(
      LANGUAGE_NONE => array(
        array(
          'value' => 'Child TermZ' . $this
            ->randomName(),
        ),
        array(
          'value' => 'Child TermA' . $this
            ->randomName(),
        ),
      ),
    ),
  );
  taxonomy_term_save($this->terms['child_term']);
  $this->terms['normal_term'] = (object) array(
    'vid' => $this->vocabulary->vid,
    'name' => 'Normal Term',
    $this->fields['enabled']['field']['field_name'] => array(
      LANGUAGE_NONE => array(
        array(
          'value' => 'Normal TermA' . $this
            ->randomName(),
        ),
        array(
          'value' => 'Normal TermZ' . $this
            ->randomName(),
        ),
      ),
    ),
  );
  taxonomy_term_save($this->terms['normal_term']);
}