You are here

private function UIFTestCaseFieldFields::createTerm in User Import Framework 7

Returns a new term with some name.

1 call to UIFTestCaseFieldFields::createTerm()
UIFTestCaseFieldFields::setUp in ./uif.test
Sets up a Drupal site for running functional and integration tests.

File

./uif.test, line 366
UIF test code.

Class

UIFTestCaseFieldFields
Test import with Field module fields.

Code

private function createTerm($vocabulary, $name) {
  $term = new stdClass();
  $term->name = $name;
  $term->description = $name;

  // Use the first available text format.
  $term->format = db_query_range('SELECT format FROM {filter_format}', 0, 1)
    ->fetchField();
  $term->vid = $vocabulary->vid;
  taxonomy_term_save($term);
  return $term;
}