You are here

function PathautoTestHelper::addTerm in Pathauto 6.2

Same name and namespace in other branches
  1. 6 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 163
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;
}