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) {
  $term = new TaxonomyTerm();
  $term->name = $this->randomName();
  $term->description = $this->randomName();
  $term->vocabulary = $vocabulary_name;
  $term->save();
  return $term;
}