You are here

protected function SynonymsTermMergeWebTestCase::createTerms in Term Merge 7

Supportive method.

Create a list of terms, assigning names according to the values of the supplied array.

Parameters

array $terms: Array of machine readable term keys based on which is generated output

Return value

array Array of taxonomy term objects name of which is equal to the value that corresponds to its position in the supplied array

2 calls to SynonymsTermMergeWebTestCase::createTerms()
SynonymsTermMergeWebTestCase::testTermMergeAction in ./term_merge.test
Test the action 'term_merge_action' in terms of integration with Synonyms.
SynonymsTermMergeWebTestCase::testTermMergeBatch in ./term_merge.test
Test Term Merge batch in terms of integration with Synonyms module.

File

./term_merge.test, line 1491
Test the Term Merge module.

Class

SynonymsTermMergeWebTestCase
Test the integration between Term Merge module and Synonyms module.

Code

protected function createTerms($terms) {
  $return = array();
  foreach ($terms as $v) {
    $this
      ->drupalPost('admin/structure/taxonomy/' . $this->vocabulary->machine_name . '/add', array(
      'name' => $v,
    ), 'Save');
    $return[$v] = $this
      ->getLastTerm($this->vocabulary);
  }
  return $return;
}