You are here

public function AbstractSearchSynonymsWebTestCase::setUp in Synonyms 7

SetUp method.

Overrides SynonymsWebTestCase::setUp

2 calls to AbstractSearchSynonymsWebTestCase::setUp()
NodeSearchSynonymsWebTestCase::setUp in synonyms_search/synonyms_search.test
SetUp method.
TermSearchSynonymsWebTestCase::setUp in synonyms_search/synonyms_search.test
SetUp method.
2 methods override AbstractSearchSynonymsWebTestCase::setUp()
NodeSearchSynonymsWebTestCase::setUp in synonyms_search/synonyms_search.test
SetUp method.
TermSearchSynonymsWebTestCase::setUp in synonyms_search/synonyms_search.test
SetUp method.

File

synonyms_search/synonyms_search.test, line 30
Tests for the Synonyms Search module.

Class

AbstractSearchSynonymsWebTestCase
Base class for tests of Synonyms Search module.

Code

public function setUp($modules = array()) {
  $this->behavior_implementation['behavior'] = 'search';
  array_unshift($modules, 'synonyms_search');
  parent::setUp($modules);

  // Create a few terms and synonyms.
  $term = (object) array(
    'vid' => $this->vocabulary->vid,
    'name' => $this
      ->randomName(),
    $this->fields['disabled']['field']['field_name'] => array(
      LANGUAGE_NONE => array(
        array(
          'value' => $this
            ->randomName(),
        ),
      ),
    ),
  );
  taxonomy_term_save($term);
  $this->terms['no_synonyms'] = $term;
  $term = (object) array(
    'vid' => $this->vocabulary->vid,
    'name' => $this
      ->randomName(),
    $this->fields['enabled']['field']['field_name'] => array(
      LANGUAGE_NONE => array(
        array(
          'value' => $this
            ->randomName(),
        ),
      ),
    ),
    $this->fields['disabled']['field']['field_name'] => array(
      LANGUAGE_NONE => array(
        array(
          'value' => $this
            ->randomName(),
        ),
      ),
    ),
  );
  taxonomy_term_save($term);
  $this->terms['one_synonym'] = $term;
  $term = (object) array(
    'vid' => $this->vocabulary->vid,
    'name' => $this
      ->randomName(),
    $this->fields['enabled']['field']['field_name'] => array(
      LANGUAGE_NONE => array(
        array(
          'value' => $this
            ->randomName(),
        ),
        array(
          'value' => $this
            ->randomName(),
        ),
      ),
    ),
    $this->fields['disabled']['field']['field_name'] => array(
      LANGUAGE_NONE => array(
        array(
          'value' => $this
            ->randomName(),
        ),
      ),
    ),
  );
  taxonomy_term_save($term);
  $this->terms['two_synonyms'] = $term;
}