1 views_ui.test ViewsUIWizardJumpMenuTestCase::createTaxonomyTermAndGetPath()

Helper function to create a taxonomy term and return its expected path.

File

core/modules/views/tests/views_ui.test, line 692
Tests Views UI Wizard.

Class

ViewsUIWizardJumpMenuTestCase
Tests the ability of the views wizard to create views with a jump menu style plugin.

Code

function createTaxonomyTermAndGetPath() {
  $vocabulary = new TaxonomyVocabulary(array(
    'name' => $this->randomName(),
    'machine_name' => backdrop_strtolower($this->randomName()),
  ));
  taxonomy_vocabulary_save($vocabulary);

  $term = entity_create('taxonomy_term', array(
    'name' => $this->randomName(),
    'vocabulary' => $vocabulary->machine_name,
  ));
  taxonomy_term_save($term);

  return entity_uri('taxonomy_term', $term);
}