You are here

function PathautoTestHelper::addTerm in Pathauto 7

Same name and namespace in other branches
  1. 6.2 pathauto.test \PathautoTestHelper::addTerm()
  2. 6 pathauto.test \PathautoTestHelper::addTerm()
2 calls to PathautoTestHelper::addTerm()
PathautoFunctionalTestCase::testProgrammaticEntityCreation in ./pathauto.test
Test programmatic entity creation for aliases.
PathautoUnitTestCase::testPathTokens in ./pathauto.test
Test the handling of path vs non-path tokens in pathauto_clean_token_values().

File

./pathauto.test, line 101
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)),
    'vocabulary_machine_name' => $vocabulary->machine_name,
    'vid' => $vocabulary->vid,
  );
  $term = (object) $term;
  taxonomy_term_save($term);
  return $term;
}