| 7 taxonomy.test | TaxonomyWebTestCase::createTerm($vocabulary) |
| 8 taxonomy.test | TaxonomyWebTestCase::createTerm($vocabulary) |
Returns a new term with random properties in vocabulary $vid.
File
- modules/
taxonomy/ taxonomy.test, line 32 - Tests for taxonomy.module.
Code
function createTerm($vocabulary) {
$term = new stdClass();
$term->name = $this->randomName();
$term->description = $this->randomName();
// Use the first available text format.
$term->format = db_query_range('SELECT format FROM {filter_format}', 0, 1)->fetchField();
$term->vid = $vocabulary->vid;
taxonomy_term_save($term);
return $term;
}
Login or register to post comments