You are here

protected function RedirectTermMergeWebTestCase::createTerms in Term Merge 7

Supportive method.

Create a list of terms, assigning path aliases 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 path alias of which is equal to the value that corresponds to its position in the supplied array

2 calls to RedirectTermMergeWebTestCase::createTerms()
RedirectTermMergeWebTestCase::testTermMergeAction in ./term_merge.test
Test the action 'term_merge_action' in terms of integration with Redirect.
RedirectTermMergeWebTestCase::testTermMergeBatch in ./term_merge.test
Test Term Merge batch in terms of integration with Redirect/Path modules.

File

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

Class

RedirectTermMergeWebTestCase
Test the integration between Term Merge module and Path/Redirect modules.

Code

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