You are here

function PathautoTestHelper::addTerm in Pathauto 6

Same name and namespace in other branches
  1. 6.2 pathauto.test \PathautoTestHelper::addTerm()
  2. 7 pathauto.test \PathautoTestHelper::addTerm()
2 calls to PathautoTestHelper::addTerm()
PathautoTaxonomyTokenTestCase::testCatTokens in ./pathauto.test
Test the [catpath] and [catalias] tokens.
PathautoTaxonomyTokenTestCase::testTermTokens in ./pathauto.test
Test the [termpath] token.

File

./pathauto.test, line 160
Functionality tests for Pathauto.

Class

PathautoTestHelper
Helper test class with some added functions for testing.

Code

function addTerm(stdClass $vocabulary, array $term = array()) {
  $term += array(
    'name' => drupal_strtolower($this
      ->randomName(5)),
    'vid' => $vocabulary->vid,
  );
  taxonomy_save_term($term);
  return (object) $term;
}