1 token.test | TokenEntityTestCase::addTerm(TaxonomyVocabulary $vocabulary, array $term = array()) |
File
- core/
modules/ simpletest/ tests/ token.test, line 817 - Test integration for the token module.
Class
Code
function addTerm(TaxonomyVocabulary $vocabulary, array $term = array()) {
$term += array(
'name' => backdrop_strtolower($this->randomName(5)),
'vocabulary' => $vocabulary->machine_name,
'parents' => array(0),
);
$term = new TaxonomyTerm($term);
$term->save();
return $term;
}