function TaxonomyMenuWebTestCase::createVocabulary in Taxonomy menu 7
Returns a new vocabulary with random properties.
2 calls to TaxonomyMenuWebTestCase::createVocabulary()
- TaxonomyMenuHierarchyTest::setUp in ./
taxonomy_menu.test - Sets up a Drupal site for running functional and integration tests.
- TaxonomyMenuUnitTest::setUp in ./
taxonomy_menu.test - Sets up a Drupal site for running functional and integration tests.
File
- ./
taxonomy_menu.test, line 15 - Tests for taxonomy_menu.module.
Class
- TaxonomyMenuWebTestCase
- Class with common helper methods.
Code
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;
}