1 path_pattern.test PathPatternTestHelper::addTerm(TaxonomyVocabulary $vocabulary, array $term = array())

File

core/modules/path/tests/path_pattern.test, line 106
Functionality tests for automatic path generation.

Class

PathPatternTestHelper
Helper test class with some added functions for testing.

Code

function addTerm(TaxonomyVocabulary $vocabulary, array $term = array()) {
  $term += array(
    'name' => backdrop_strtolower($this->randomName(5)),
    'vocabulary' => $vocabulary->machine_name,
    'parent' => array(0),
  );
  $term = new TaxonomyTerm($term);
  taxonomy_term_save($term);
  return $term;
}