1 path_pattern.test PathPatternTestHelper::addVocabulary(array $vocabulary = array())

File

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

Class

PathPatternTestHelper
Helper test class with some added functions for testing.

Code

function addVocabulary(array $vocabulary = array()) {
  $name = backdrop_strtolower($this->randomName(5));
  $vocabulary += array(
    'name' => $name,
    'machine_name' => $name,
  );
  $vocabulary = new TaxonomyVocabulary($vocabulary);
  taxonomy_vocabulary_save($vocabulary);
  return $vocabulary;
}