1 views_query.test protected ViewsSqlTest::viewsCreateTerm($vocabulary_name)

Create a term.

Parameters

int $vocabulary_name: The vocabulary name that the term is to be added to.

Return value

object: A full term object with a random name.

File

core/modules/views/tests/views_query.test, line 161
Tests for Views query features.

Class

ViewsSqlTest

Code

protected function viewsCreateTerm($vocabulary_name) {
  /** @var TaxonomyTerm $term */
  $term = entity_create('taxonomy_term', array());
  $term->name = $this->randomName();
  $term->description = $this->randomName();
  $term->vocabulary = $vocabulary_name;
  $term->save();
  return $term;
}