1.20.x views_handler_manytoone.test | protected ViewsHandlerManyToOneTest::createTerm($vocabulary) |
Returns a new term with random properties.
Parameters
string $vocabulary: Vocabulary name to create term in.
Return value
TaxonomyTrem: Term with random properties.
File
- modules/
views/ tests/ handlers/ views_handler_manytoone.test, line 67 - Definition of ViewsHandlerManyToOneTest.
Class
- ViewsHandlerManyToOneTest
- Tests the many to one helper handler class.
Code
protected function createTerm($vocabulary) {
$term = entity_create('taxonomy_term', array(
'name' => $this->randomName(),
'description' => $this->randomName(),
'format' => 'plain_text',
'vocabulary' => $vocabulary->machine_name,
));
taxonomy_term_save($term);
return $term;
}