You are here

function HierarchicalTermFormatterTestCase::createVocabulary in Hierarchical Term Formatter 7

Returns a new vocabulary with random properties.

1 call to HierarchicalTermFormatterTestCase::createVocabulary()
HierarchicalTermFormatterTestCase::setUp in ./hierarchical_term_formatter.test
Sets up a Drupal site for running functional and integration tests.

File

./hierarchical_term_formatter.test, line 26
Tests for Field Multiple Limit, based on examples from field.test

Class

HierarchicalTermFormatterTestCase
Test the field formatter settings work.

Code

function createVocabulary() {

  // Create a vocabulary.
  $vocabulary = new stdClass();
  $vocabulary->name = $this
    ->randomName();
  $vocabulary->description = 'Vocabulary description is ' . $this
    ->randomName();
  $vocabulary->machine_name = drupal_strtolower($vocabulary->name);
  $vocabulary->help = '';
  $vocabulary->nodes = array(
    'page' => 'page',
  );
  $vocabulary->weight = mt_rand(0, 10);
  taxonomy_vocabulary_save($vocabulary);
  return $vocabulary;
}