You are here

function dfpBaseTest::createTerm in Doubleclick for Publishers (DFP) 7

Same name and namespace in other branches
  1. 7.2 tests/dfp.test \dfpBaseTest::createTerm()

Create a taxonomy term.

1 call to dfpBaseTest::createTerm()
dfpAdCategoriesTest::testDisplayAdCategories in tests/dfp_ad_categories.test

File

tests/dfp_base.test, line 103
Base test file for DFP module.

Class

dfpBaseTest
@file Base test file for DFP module.

Code

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

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