You are here

function BlogapiTestCase::createTerm in Blog API 7.2

Returns a new term with random properties in vocabulary $vid.

4 calls to BlogapiTestCase::createTerm()
BlogapiMetaweblogEndpointTestCase::testGetCategories in modules/blogapi_metaweblog/blogapi_metaweblog.test
Test metaWeblog.getCategories().
BlogapiMovabletypeEndpointTestCase::testGetCategoryList in modules/blogapi_movabletype/blogapi_movabletype.test
Test mt.getCategoryList().
BlogapiMovabletypeEndpointTestCase::testGetPostCategories in modules/blogapi_movabletype/blogapi_movabletype.test
Test mt.getPostCategories().
BlogapiMovabletypeEndpointTestCase::testSetPostCategories in modules/blogapi_movabletype/blogapi_movabletype.test
Test mt.setPostCategories().

File

./blogapi.test, line 160
Test for general BlogAPI functionality

Class

BlogapiTestCase
@file Test for general BlogAPI functionality

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