You are here

function PathautoTestHelper::addVocabulary in Pathauto 7

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

File

./pathauto.test, line 89
Functionality tests for Pathauto.

Class

PathautoTestHelper
Helper test class with some added functions for testing.

Code

function addVocabulary(array $vocabulary = array()) {
  $name = drupal_strtolower($this
    ->randomName(5));
  $vocabulary += array(
    'name' => $name,
    'machine_name' => $name,
    'nodes' => array(
      'article' => 'article',
    ),
  );
  $vocabulary = (object) $vocabulary;
  taxonomy_vocabulary_save($vocabulary);
  return $vocabulary;
}