function TaxonomyWebTestCase::createVocabulary
Returns a new vocabulary with random properties.
25 calls to TaxonomyWebTestCase::createVocabulary()
- RdfMappingDefinitionTestCase::testTaxonomyTermRdfaAttributes in modules/
rdf/ rdf.test - Creates a random term and ensures the right RDFa markup is used.
- TaxonomyEFQTestCase::setUp in modules/
taxonomy/ taxonomy.test - Sets up a Drupal site for running functional and integration tests.
- TaxonomyEFQTestCase::testTaxonomyEFQ in modules/
taxonomy/ taxonomy.test - Tests that a basic taxonomy EntityFieldQuery works.
- TaxonomyHooksTestCase::testTaxonomyTermHooks in modules/
taxonomy/ taxonomy.test - Test that hooks are run correctly on creating, editing, viewing, and deleting a term.
- TaxonomyLoadMultipleTestCase::testTaxonomyTermMultipleLoad in modules/
taxonomy/ taxonomy.test - Create a vocabulary and some taxonomy terms, ensuring they're loaded correctly using taxonomy_term_load_multiple().
File
-
modules/
taxonomy/ taxonomy.test, line 16
Class
- TaxonomyWebTestCase
- Provides common helper methods for Taxonomy module tests.
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;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.