Returns a new term with random properties in vocabulary $vid.
function createTerm($vocabulary) {
$term = entity_create('taxonomy_term', array(
'name' => $this
->randomName(),
'description' => $this
->randomName(),
// Use the first available text format.
'format' => db_query_range('SELECT format FROM {filter_format}', 0, 1)
->fetchField(),
'vid' => $vocabulary->vid,
'langcode' => LANGUAGE_NOT_SPECIFIED,
));
taxonomy_term_save($term);
return $term;
}