1 views_handler_manytoone.test protected ViewsHandlerManyToOneTest::createTerm($vocabulary)

Returns a new term with random properties.

Parameters

TaxonomyVocabulary $vocabulary: Vocabulary to create term in.

Return value

TaxonomyTerm: Term with random properties.

File

core/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;
}