You are here

function TaxonomyAccessTestCase::createVocab in Taxonomy Access Control 7

Creates a vocabulary with a certain name.

Parameters

string $machine_name: A machine-safe name.

Return value

object The vocabulary object.

3 calls to TaxonomyAccessTestCase::createVocab()
TaxonomyAccessConfigTest::setUp in ./taxonomy_access.test
Sets up a Drupal site for running functional and integration tests.
TaxonomyAccessNodeGrantTest::setUp in ./taxonomy_access.test
Sets up a Drupal site for running functional and integration tests.
TaxonomyAccessTermGrantTest::setUp in ./taxonomy_access.test
Sets up a Drupal site for running functional and integration tests.

File

./taxonomy_access.test, line 94
Automated tests for the Taxonomy Access Control module.

Class

TaxonomyAccessTestCase
Provides a base test class and helper methods for automated tests.

Code

function createVocab($machine_name) {
  $vocabulary = new stdClass();
  $vocabulary->name = $machine_name;
  $vocabulary->description = $this
    ->randomName();
  $vocabulary->machine_name = $machine_name;
  $vocabulary->help = '';
  $vocabulary->weight = mt_rand(0, 10);
  taxonomy_vocabulary_save($vocabulary);
  return $vocabulary;
}