You are here

public function ConfigurationWebTestCase::createVocabulary in Configuration Management 7

Returns a new vocabulary with random properties.

3 calls to ConfigurationWebTestCase::createVocabulary()
ConfigurationActiveStoreOverriddenTest::setUp in tests/configuration.test
Set up test.
ConfigurationTrackingTest::setUp in tests/configuration.test
Set up test.
ConfigurationUITest::setUp in tests/configuration.test
Set up test.

File

tests/configuration.test, line 83
Tests for Configuration Management

Class

ConfigurationWebTestCase
Base class for functional tests for configuration management.

Code

public function createVocabulary() {

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